Age | Commit message (Collapse) | Author |
|
Use a shorter/simpler license convention, stops the header taking so
much space.
Follow the SPDX license specification: https://spdx.org/licenses
- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile
While most of the source tree has been included
- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
use different header conventions.
doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.
See P2788 for the script that automated these edits.
Reviewed By: brecht, mont29, sergey
Ref D14069
|
|
In the original design draw engines had to copy with a limitation that
they were not allowed to reuse complex data structures between drawing
calls. Data that could be reused were limited to:
- GPUFramebuffers
- GPUTextures
- Memory that could be removed calling MEM_freeN (storage list)
- DRWPass
This is fine when the storage list contains arrays or structs but when
more complex data types (vectors, maps) etc wasn't possible.
This patch adds instance_data that can be reused between drawing calls.
The instance_data is controlled by the draw engine and doesn't need to
be limited as described above.
When an engines stores instance_data it must implement the
`DrawEngineType.instance_free` callback to free the data.
The patch originates from eevee rewrite. But was added to master as the
image engine rewrite also has a need for it.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D13425
|
|
|
|
This patch adds shader compilation tests for the basic engine in `shaders_test.cc`
Addresses T92701
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D13066
|
|
This patch adds support for selecting pointclouds.
Since pointclouds were not properly drawn to the selection buffer (as diagonsed by output from `glReadPixels` and Renderdoc), they were not able to be selectable by depth picking or occlusion queries. In `basic_engine`, objects were rendered with a shader which draws to a depth buffer but only assumes a single position vertex attribute. Pointclouds, though, require at least another vertex attribute `pos_inst` which provides the instance offsets. Thus, this patch adds another shader variant for pointclouds which supports these two attributes and renders the points appropriately.
{F11652666}
Addresses T92415
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D13059
|
|
This reverts commit a50f8b3fd8e74d7cc0f2224f110c85493acee1cc.
|
|
This patch adds support for selecting pointclouds.
Since pointclouds were not properly drawn to the selection buffer (as diagonsed by output from `glReadPixels` and Renderdoc), they were not able to be selectable by depth picking or occlusion queries. In `basic_engine`, objects were rendered with a shader which draws to a depth buffer but only assumes a single position vertex attribute. Pointclouds, though, require at least another vertex attribute `pos_inst` which provides the instance offsets. Thus, this patch adds another shader variant for pointclouds which supports these two attributes and renders the points appropriately.
{F11652666}
Addresses T92415
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D13059
|
|
This patch allows dropping material assets from material slot under the mouse
cursor. Before this change the material slot had to be hand-picked from the
properties panel.
For consistency it is chosen to do this in any shading mode as the tooltip shows
what is exactly going to happen during release.
The feature also works for other object types than Meshes as it uses the drawn surface on the
GPU to detect the material slots. Performance of this patch has been tested with AMD GCN3.0
cards and are very responsive.
Reviewed By: fclem, Severin
Differential Revision: https://developer.blender.org/D12190
|
|
Stores cryptomatte hashes as meta data to the render result. Compositors could
use this for lookup on names in stead of hashes.
Differential Revision: https://developer.blender.org/D9553
|
|
Following the most widely used convention for including todo's in
the code, that is: `TODO(name):`, `FIXME(name)` ... etc.
|
|
|
|
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.
This patch has been generated by P1561 followed by `make format`.
Differential Revision: https://developer.blender.org/D8466
|
|
This is to match the option name and to avoid confusion with
workbench xray mode.
|
|
|
|
|
|
When sculpting the GPU batches are constructed with only the required data
for a single viewport. When that viewport changes shading or coloring mode (object
to vertex) batches might not hold all the needed information.
There is also a case when you have two 3d viewport one in object color
mode and the other in vertex color mode that the GPU batches were
updated without any vertex colors.
In order to fix these category of issues this patch would always
construct the full GPU batches for sculpting.
Reviewed By: Clément Foucault, Pablo Dobarro
Maniphest Tasks: T75908
Differential Revision: https://developer.blender.org/D7701
|
|
{rB3685347b4172} introduced a conservative depth rendering for
selection. The conservative depth rendering assumed that all geometry
are triangle based. Hair is lined base.
This patch will use a normal depth shader for rendering hair.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D7661
|
|
|
|
Reviewed By: brecht sergey jbakker
Differential Revision: http://developer.blender.org/D6729
|
|
The conservative depth shader is ~4.5x slower than the normal one as it
uses geometry shader and fragment shader discard.
This patch also includes a hack to also fix the view parallel planar
geometry and the really small wire objects.
For some reason, the conservative raster fix does not work with normal
selection but does with box select.
This is a fix for T63356.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D6714
|
|
This is the unification of all overlays into one overlay engine as described in T65347.
I went over all the code making it more future proof with less hacks and removing old / not relevent parts.
Goals / Acheivements:
- Remove internal shader usage (only drw shaders)
- Remove viewportSize and viewportSizeInv and put them in gloabl ubo
- Fixed some drawing issues: Missing probe option and Missing Alt+B clipping of some shader
- Remove old (legacy) shaders dependancy (not using view UBO).
- Less shader variation (less compilation time at first load and less patching needed for vulkan)
- removed some geom shaders when I could
- Remove static e_data (except shaders storage where it is OK)
- Clear the way to fix some anoying limitations (dithered transparency, background image compositing etc...)
- Wireframe drawing now uses the same batching capabilities as workbench & eevee (indirect drawing).
- Reduced complexity, removed ~3000 Lines of code in draw (also removed a lot of unused shader in GPU).
- Post AA to avoid complexity and cost of MSAA.
Remaining issues:
- ~~Armature edits, overlay toggles, (... others?) are not refreshing viewport after AA is complete~~
- FXAA is not the best for wires, maybe investigate SMAA
- Maybe do something more temporally stable for AA.
- ~~Paint overlays are not working with AA.~~
- ~~infront objects are difficult to select.~~
- ~~the infront wires sometimes goes through they solid counterpart (missing clear maybe?) (toggle overlays on-off when using infront+wireframe overlay in solid shading)~~
Note: I made some decision to change slightly the appearance of some objects to simplify their drawing. Namely the empty arrows end (which is now hollow/wire) and distance points of the cameras/spots being done by lines.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D6296
|
|
|
|
Make a distinction between flush sculpt changes for rendering, and forcing
sculpt data structures to be rebuilt after mesh changes. Also don't use PBVH
for renders.
|
|
Basically the solution is to call `DRW_shgroup_call_sculpt` when `BKE_sculptsession_use_pbvh_draw(...)` is true.
Ref T67259
Reviewers: fclem, jbakker, brecht
Reviewed By: fclem, brecht
Maniphest Tasks: T67259
Differential Revision: https://developer.blender.org/D5396
|
|
|
|
This cleans up a bit of duplicated code and some confusion about
what was culled and what wasn't.
Now everything is culled based on the given object pointer.
If the object pointer is NULL there is no culling performed.
|
|
|
|
This should be handled by DST.view_default
|
|
This removes:
- DRW_STATE_TRANS_FEEDBACK
- DRW_STATE_WIRE
- DRW_STATE_POINT
|
|
|
|
The culing still seems to be off but at least it is enabled now.
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
Most API's already use this convention.
|
|
|
|
Draw manager was checking for particles being enabled in viewport, but
actual evaluation was happening for render. Now the check in draw manager
properly follows current evaluation mode.
Additionally, de-duplicated some check, by moving everything needed to
a single place.
Annoying part is the const-cast, that could be cleaned up later by
modifying some underlying functions.
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Also compare clipping with the draw context instead of
accessing the RegionView3D, currently they're matching
but this might not always be the case.
|
|
The struct name is descriptive,
this isn't going to be confused with other variables.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
Needed to fix T61196, supporting clipped back-buffer in the 3D view
which is done outside the draw module.
It was also inconvenient having DRW_shader_* versions of GPU_shader_*
API calls.
- Clipping distances are now supported as a shader configuration
for builtin shaders.
- Add shader config argument when accessing builtin shaders.
- Move GPU_shader_create_from_arrays() from DRW to GPU.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
Improve clang-format output.
|
|
|
|
Object selection now supports clipping.
|
|
|
|
|
|
Overlay options shouldn't be used when overlays are disabled.
Move to shading popover, reported as T58070.
|
|
THis is in order to avoid the jungle of names being different at each
step of the API.
Also removes some unused functions.
|
|
The problem was double. They were not selectable in wireframe view and
they would not display with the right color, thus always appearing
un-selected.
|
|
This now only upload data per loops to the GPU, making use of index buffer
to draw polygon. This make use of the vertex cache, speed up renders
and saves a lot of vram.
Update performance is also slightly faster and can even be improved further
by updating only uvs or vcol independently.
This commits breaks texture paint batches. It will be added back in another
commit.
|