Convert shrinkwrap data arrays to use C++ arrays and BitVector,
use references in "EditMeshData" code, and store both structs
with `std::unique_ptr` instead of a raw allocation.
If I remember correctly, this was needed during development of
89e3ba4e25, but not anymore. Now the face normals are used
if faces are sharp. And if there is a mixture of sharp and smooth faces,
then normals_domain will be Corner anyway.
In a basic test with a 16 million face grid, this saved 30ms every draw
extraction. It also saves about 12 bytes per corner which was cached on
the mesh before.
There's a chance I'm missing something and this will require changes
elsewhere, but it's working well in my testing.
Since changing the reference color space to XYZ E, there was some imprecision
in color space conversions.
Change the XYZ D65 to Linear Rec.709 conversion matrix very slightly to avoid
values rounding the wrong way.
Updated matrix provided by Zijun Zhou.
Pull Request: https://projects.blender.org/blender/blender/pulls/115767
This is just a bit more ergonomic and works a bit better with our C++
math vector types. Also, during PBVH build, don't store the center of
each triangle/grid. That's redundant and can always be recalculated
from the bounds.
Flag enables backends to differentiate between a framebuffer
bind with a custom loadstore state and a standard bind.
For Metal, this resolves an ambiguous complexity about loading
or clearing attachments by only flagging the first bind call as
explicit.
This means if a framebuffer is re-bound by a secondary code-path,
the re-started render-pass will not perform a secondary load. This
now allows explicit clear state to be specified on any attachment
type. Previously only memoryless attachments supported this.
To avoid further complexity, usage of`GPU_framebuffer_clear_* `
calls in conjunction with `GPU_framebuffer_bind_ex` will now
trigger an assertion failure.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/115734
Rely on the depsgraph to detect scene updates,
using the `view_update` callback.
Remove `SceneHandle` and `scene_sync`.
Remove `reset_recalc_flag`.
Remove most `sampling.reset()` calls and their related logic,
and move the remaining ones to `Instance`.
Re-sync lights on `light_threshold` changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/115758
Similar to previous commits (7332a1eb90), use three separate
functions for updating the bounds of different PBVH types. This avoids
the use of the vertex iteration macro. Also make the functions reusable,
so they can be called directly after a brush update in the future.
The copied the material index and its smoothness to every grid,
resulting in 4 bytes of memory per base mesh face corner. That's
wasteful, since it's trivial to loop up the original data from the base
mesh attributes as necessary. This way we can also avoid the
dereference.
Automatic memory management and clearer ownership! Requires
removing `MEM_CXX_CLASS_ALLOC_FUNCS` from `MeshRuntime`,
but that's used very inconsistently anyway, and `MeshRuntime` isn't
that large.
I've seen this appear in profiles sometimes, which it really shouldn't,
since it's just a single array access. I didn't detect an observable
difference, but we don't have to think about that anymore anyway.
Instead of storing a redundant array of faces, use the base mesh faces
and corner_to_face map. This saves 8 bytes per base mesh face with
multires sculpting, and avoids recalculating the topology map whenever
reevaluating the object. There is a lot of other duplicate data between
base meshes and faces, particularly in `MeshTopology`. This is just
a first step of untangling that.
Push the undo step before changing any grid hide data, fix a missing
allocation in the undo step, and workaround some issue with temporary
BitVector<> construction that I couldn't quite figure out. Also fix a
crash when there is vertex mask attribute but no multires hiding.
Two main user-facing benefits: only nodes with actually changed
values have undo steps pushed, meaning reduced memory usage
and undo runtime, and the mask attribute is removed when cleared,
reducing memory usage and theoretically improving performance
afterwards.
On the code side, the changes consist conceptually of expanding the
PBVH vertex iter macro for each PBVH type and simplifying the resulting
logic. This results in significantly more code; the idea is that in the
future abstractions to reduce duplication will become clearer. We just
want abstractions that relate closely to the actual data processing,
which is much simpler than the existing macro makes it look.
Specialize the mask update for each PBVH type, simplifying hot loops,
reducing reliance on complex shared state and clarifying which data is
used. Expose functions to update the visibility and masks tags for a
specific node. It can be helpful to call these after modifying the data
to update the flags while the data is more likely to be in CPU caches.
Since we're always writing the mask with the old format, this versioning
will have to run until a larger breaking release such as 5.0. Luckily it
is cheap, it's just rearranging the pointers to larger arrays.
Implements #105001 - new import option for name separator, e.g. "|" or "/".
Names found in the OBJ file are split by that, and a Collection hierarchy is
made, so you can have e.g. "o House/Roof/Tile" in the OBJ file.
Pull Request: https://projects.blender.org/blender/blender/pulls/115742
Changes:
- Renamed Split Viewer Node to Split Node
- Split Node is now under `Utilities` (similar to Switch node)
- Versioning: split viewer from 4.0 and before is replaced with the new split node connected to a new viewer node.
Pull Request: https://projects.blender.org/blender/blender/pulls/114245