Age | Commit message (Collapse) | Author |
|
PBVH draw was invalidating the draw cache even
when disabled (e.g. if modifiers exist).
|
|
Currently, when subdividing every single vertex on every loose edge,
Blender iterates over all other edges to find neighbors. This has
quadratic runtime and can be very slow. Instead, first create a
map of edges connected to each vertex.
With about 10000 edges, the performance goes from very slow to very
smooth in my tests. Because of the nature of quadratic runtime, the
improvement will depend massively on the number of elements.
The only downside to this is that the map will still be built when
there are only a couple loose edges, but that case is probably not
so common.
Differential Revision: https://developer.blender.org/D15923
|
|
There are no plans to use the object attribute anymore.
|
|
|
|
|
|
|
|
Rename, add comments, and use flag in the depsgraph to ensure the logic
matches.
Differential Revision: https://developer.blender.org/D15883
|
|
Replace `mesh_attributes`, `mesh_attributes_for_write` and the point
cloud versions with methods on the `Mesh` and `PointCloud` types.
This makes them friendlier to use and improves readability.
Differential Revision: https://developer.blender.org/D15907
|
|
Follows existing naming for the most part, also use "num" as a suffix
in some instances (following our naming conventions).
|
|
It was incorrectly updated in rBc226c480079fc07e3784f673b1bac4a774fe7937
|
|
Error pointed out by tests.
|
|
|
|
|
|
Use `verts` instead of `vertices` and `polys` instead of `polygons`
in the API added in 05952aa94d33eeb50. This aligns better with
existing naming where the shorter names are much more common.
|
|
|
|
In 8cf52e8226cb we assumed that the UV IBO's are only needed in edit mode,
however the UV lines also need to work in texture paint mode. So prefer to
use bmesh when available to fix the original bug, but don't assume the face
is hidden when there is no bmesh.
Differential Revision: https://developer.blender.org/D15895
|
|
And remove retest of `GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR`.
|
|
Regression introduced in rB755e728a9840
|
|
This avoids the overhead of debug drawing when not debugging
anything or even not using the new draw manager.
|
|
|
|
3D shaders work in both 2D and 3D viewports.
This shader is a good candidate to be exposed in Python.
|
|
The only real difference between `GPU_SHADER_2D_FLAT_COLOR` and
`GPU_SHADER_3D_FLAT_COLOR` is that in the vertex shader the 2D
version uses `vec4(pos, 0.0, 1.0)` and the 3D version uses
`vec4(pos, 1.0)`.
But VBOs with 2D attributes work perfectly in shaders that use 3D
attributes. Components not specified are filled with components from
`vec4(0.0, 0.0, 0.0, 1.0)`.
So there is no real benefit to having two different shader versions.
This will simplify porting shaders to python as it will not be
necessary to use a 3D and a 2D version of the shaders.
In python the new name for '2D_FLAT_COLOR'' and '3D_FLAT_COLOR'
is 'FLAT_COLOR', but the old names still work for backward
compatibility.
|
|
For copy-on-write, we want to share attribute arrays between meshes
where possible. Mutable pointers like `Mesh.mvert` make that difficult
by making ownership vague. They also make code more complex by adding
redundancy.
The simplest solution is just removing them and retrieving layers from
`CustomData` as needed. Similar changes have already been applied to
curves and point clouds (e9f82d3dc7ee, 410a6efb747f). Removing use of
the pointers generally makes code more obvious and more reusable.
Mesh data is now accessed with a C++ API (`Mesh::edges()` or
`Mesh::edges_for_write()`), and a C API (`BKE_mesh_edges(mesh)`).
The CoW changes this commit makes possible are described in T95845
and T95842, and started in D14139 and D14140. The change also simplifies
the ongoing mesh struct-of-array refactors from T95965.
**RNA/Python Access Performance**
Theoretically, accessing mesh elements with the RNA API may become
slower, since the layer needs to be found on every random access.
However, overhead is already high enough that this doesn't make a
noticible differenc, and performance is actually improved in some
cases. Random access can be up to 10% faster, but other situations
might be a bit slower. Generally using `foreach_get/set` are the best
way to improve performance. See the differential revision for more
discussion about Python performance.
Cycles has been updated to use raw pointers and the internal Blender
mesh types, mostly because there is no sense in having this overhead
when it's already compiled with Blender. In my tests this roughly
halves the Cycles mesh creation time (0.19s to 0.10s for a 1 million
face grid).
Differential Revision: https://developer.blender.org/D15488
|
|
|
|
the Image Editor
This reverts commit 32d4a67017ecf4af75a9bfde885526550a6534ba thus fixing T81002 again.
And in order not to break T81212 (again) a different fix was implemented.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D15840
|
|
|
|
Add a dedicated `owner_id` pointer to ID types that can be embedded
(Collections and NodeTrees), and modify slightly come code to make
handling those more safe and consistent.
This implements first part of T69169.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D15838
|
|
This was cause by a missing implementation of some post
processing attribute functions. Leading to unresolved reference.
|
|
|
|
orthographic view
It was using normalized vector instead of `viewCameraVec` which account for
orthographic views.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D15861
|
|
This was caused by rB07cf3ce92fa2. It was missing a sign flip.
|
|
Changes to the text caret (cursor) when editing Text objects in the
3D Viewport.
See D15797 for more details and examples.
Differential Revision: https://developer.blender.org/D15797
Reviewed by Brecht Van Lommel
|
|
|
|
The caculation of 7th SH coefficient need a negative sign
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15635
|
|
|
|
This replaces the direct shader uniform layout declaration by a linear
search through a global buffer.
Each instance has an attribute offset inside the global buffer and an
attribute count.
This removes any padding and tighly pack all uniform attributes inside
a single buffer.
This would also remove the limit of 8 attribute but it is kept because of
compatibility with the old system that is still used by the old draw
manager.
|
|
|
|
Removes a warning and tidy the API.
|
|
This is a new implementation of the draw manager using modern
rendering practices and GPU driven culling.
This only ports features that are not considered deprecated or to be
removed.
The old DRW API is kept working along side this new one, and does not
interfeer with it. However this needed some more hacking inside the
draw_view_lib.glsl. At least the create info are well separated.
The reviewer might start by looking at `draw_pass_test.cc` to see the
API in usage.
Important files are `draw_pass.hh`, `draw_command.hh`,
`draw_command_shared.hh`.
In a nutshell (for a developper used to old DRW API):
- `DRWShadingGroups` are replaced by `Pass<T>::Sub`.
- Contrary to DRWShadingGroups, all commands recorded inside a pass or
sub-pass (even binds / push_constant / uniforms) will be executed in order.
- All memory is managed per object (except for Sub-Pass which are managed
by their parent pass) and not from draw manager pools. So passes "can"
potentially be recorded once and submitted multiple time (but this is
not really encouraged for now). The only implicit link is between resource
lifetime and `ResourceHandles`
- Sub passes can be any level deep.
- IMPORTANT: All state propagate from sub pass to subpass. There is no
state stack concept anymore. Ensure the correct render state is set before
drawing anything using `Pass::state_set()`.
- The drawcalls now needs a `ResourceHandle` instead of an `Object *`.
This is to remove any implicit dependency between `Pass` and `Manager`.
This was a huge problem in old implementation since the manager did not
know what to pull from the object. Now it is explicitly requested by the
engine.
- The pases need to be submitted to a `draw::Manager` instance which can
be retrieved using `DRW_manager_get()` (for now).
Internally:
- All object data are stored in contiguous storage buffers. Removing a lot
of complexity in the pass submission.
- Draw calls are sorted and visibility tested on GPU. Making more modern
culling and better instancing usage possible in the future.
- Unit Tests have been added for regression testing and avoid most API
breakage.
- `draw::View` now contains culling data for all objects in the scene
allowing caching for multiple views.
- Bounding box and sphere final setup is moved to GPU.
- Some global resources locations have been hardcoded to reduce complexity.
What is missing:
- ~~Workaround for lack of gl_BaseInstanceARB.~~ Done
- ~~Object Uniform Attributes.~~ Done (Not in this patch)
- Workaround for hardware supporting a maximum of 8 SSBO.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D15817
|
|
# Conflicts:
# release/scripts/addons
|
|
This was caused by un-wanted normalization. This is a requirement of
the MikkTspace. The issue is that g_data.N is expected to be normalized
by many other functions and overriden by bump displacement.
Adding a new global variable containing the interpolated normal fixes the
issue AND make it match cycles behavior better (mix between bump and
interpolated normal).
|
|
This patch implements the dilate/erode node for the realtime compositor.
Differential Revision: https://developer.blender.org/D15790
Reviewed By: Clement Foucault
|
|
Upcoming cryptomatte patch would need access to these defines. So moving
them from film_lib to shader shared. We cannot include the film_lib as
it requires images/textures to be bound that we don't need.
At the same time fixes incorrect casing (`lAYER` => `LAYER`).
|
|
GPUCapabilities expansion.
- Adding in compatibility paths to support minimum per-vertex strides for vertex formats. OpenGL supports a minimum stride of 1 byte, in Metal, this minimum stride is 4 bytes. Meaing a vertex format must be atleast 4-bytes in size.
- Replacing transform feedback compile-time check to conditional look-up, given TF is supported on macOS with Metal.
- 3D texture size safety check added as a general capability, rather than being in the gl backend only. Also required for Metal.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D14510
|
|
This avoids redundant operation at draw time.
The per attrib hash is to be used with the future implementation.
|
|
Use lowercase rgba channel names which still by-passes lossy nature
of DWA compression and which also keeps external compositing tools
happy.
Thanks Steffen Dünner for testing this patch!
Differential Revision: https://developer.blender.org/D15834
|
|
The DWA compression code in OpenEXR has hardcoded rules which decides
which channels are lossy or lossless. There is no control over these
rules via API.
This change makes it so channel names of xyzw is used for cryptomatte
passes in Cycles. This works around the hardcoded rules in the DWA code
making it so lossless compression is used. It is important to use lower
case y channel name as the upper case Y uses lossy compression.
The change in the channel naming also makes it so the write code uses
32bit for the cryptomatte even when saving half-float EXR.
Fixes T96933: Cryptomatte layers saved incorrectly with EXR DWA compression
Fixes T88049: Cryptomatte EXR Output Bit Depth should always be 32bit
Differential Revision: https://developer.blender.org/D15823
|
|
This patch is a cleanup required before refactoring the view layer syncing
process {T73411}.
* Remove FIRSTBASE.
* Remove LASTBASE.
* Remove BASACT.
* Remove OBEDIT_FROM_WORKSPACE.
* Replace OBACT with BKE_view_layer_active_object.
* Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object.
Reviewed By: mont29
Maniphest Tasks: T73411
Differential Revision: https://developer.blender.org/D15799
|
|
|
|
Note: does not fix the limit in PBVH draw which is
caused by VBO limits not MAX_MCOL.
|