The test uses a none points shader to draw points, which is incorrect
and asserts when using Vulkan. It also didn't test the gpu part of the
pipeline (PassMain).
When using PassMain the order of the resources are expected to be
different as the draw calls are ordered based on the primitive type and
handles.
Pull Request: https://projects.blender.org/blender/blender/pulls/117714
This implements the `stroke_arrange` operator for grease pencil v3.
This behaves the same as `GPENCIL_OT_stroke_arrange` but renamed to `stroke_reorder`.
It should be more clear what the operator does.
Note: This also adds new key binds.
Co-authored-by: Falk David <filedescriptor@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/116682
The simulation input and output node are closely related and also share some code.
That's easier to handle if they are in the same file.
I also extracted out the code to mix geometries.
Pull Request: https://projects.blender.org/blender/blender/pulls/117713
This changes the tooltip for the user preference settings
`Only Insert Needed` and `Only Insert Available`
to better explain what these features are for.
Only Insert Available
Automatic keyframe insertion in available F-Curves
-> Insert Keyframes only for properties that are already animated
Auto-Key Needed
Auto-Keyframe insertion only when keyframe needed
-> Auto-Keying will skip inserting keys that don't affect the animation
Manual Key Needed
Keyframe insertion only when keyframe needed
-> When keying manually, skip inserting keys that don't affect the animation
Pull Request: https://projects.blender.org/blender/blender/pulls/117270
Previously a storage buffer was used to store draw list commands as it
matches already existing APIs. Unfortunately StorageBuffers prefers to
be stored on the GPU device and would reduce the benefit of a dynamic
draw list.
This PR replaces the storage buffer with a regular buffer, which keeps
more control where to store the buffer.
Pull Request: https://projects.blender.org/blender/blender/pulls/117712
This would still overwrite (even though frames existed).
Mistake in 6b9a500a3a.
char "filepath" was already in use/shadowed, instead use "filepath_view" to
correctly glue path/suffix together (as done already a bit below for the
R_TOUCH case).
Pull Request: https://projects.blender.org/blender/blender/pulls/117696
With this patch, materials are kept intact in simulation zones and bake nodes
without any additional user action.
This implements the design proposed in #108410 to support referencing
data-blocks (only materials for now) in the baked data. The task also describes
why this is not a trivial issue. A previous attempt was implemented in #109703
but it didn't work well-enough.
The solution is to have an explicit `name (+ library name) -> data-block`
mapping that is stored in the modifier for each bake node and simulation zone.
The `library name` is necessary for it to be unique within a .blend file. Note
that this refers to the name of the `Library` data-block and not a file path.
The baked data only contains the names of the used data-blocks. When the baked
data is loaded, the correct material data-block is looked up from the mapping.
### Automatic Mapping Generation
The most tricky aspect of this approach is to make it feel mostly automatic.
From the user point-of-view, it should just work. Therefore, we don't want the
user to have to create the mapping manually in the majority of cases. Creating
the mapping automatically is difficult because the data-blocks that should
become part of the mapping are only known during depsgraph evaluation. So we
somehow have to gather the missing data blocks during evaluation and then write
the new mappings back to the original data.
While writing back to original data is something we do in some cases already,
the situation here is different, because we are actually creating new relations
between data-blocks. This also means that we'll have to do user-counting. Since
user counts in data-blocks are *not* atomic, we can't do that from multiple
threads at the same time. Also, under some circumstances, it may be necessary to
trigger depsgraph evaluation again after the write-back because it actually
affects the result.
To solve this, a small new API is added in `DEG_depsgraph_writeback_sync.hh`. It
allows gathering tasks which write back to original data in a synchronous way
which may also require a reevaluation.
### Accessing the Mapping
A new `BakeDataBlockMap` is passed to geometry nodes evaluation by the modifier.
This map allows getting the `ID` pointer that should be used for a specific
data-block name that is stored in baked data. It's also used to gather all the
missing data mappings during evaluation.
### Weak ID References
The baked/cached geometries may have references to other data-blocks (currently
only materials, but in the future also e.g. instanced objects/collections).
However, the pointers of these data-blocks are not stable over time. That is
especially true when storing/loading the data from disk, but also just when
playing back the animation. Therefore, the used data-blocks have to referenced
in a different way at run-time.
This is solved by adding `std::unique_ptr<bake::BakeMaterialsList>` to the
run-time data of various geometry data-blocks. If the data-block is cached over
a longer period of time (such that material pointers can't be used directly), it
stores the material name (+ library name) used by each material slot. When the
geometry is used again, the material pointers are restored using these weak name
references and the `BakeDataBlockMap`.
### Manual Mapping Management
There is a new `Data-Blocks` panel in the bake settings in the node editor
sidebar that allows inspecting and modifying the data-blocks that are used when
baking. The user can change what data-block a specific name is mapped to.
Pull Request: https://projects.blender.org/blender/blender/pulls/117043
When drawing curves or particle hair, the hair is refined using GPU
shaders. See eParticleRefineShaderType. OpenGL since Blender 4.0
always uses compute shaders. Metal since Blender 4.1 always uses
compute shaders. Vulkan will only uses compute shaders.
The transform feedback isn't used and not supported by our vulkan backend.
Transform feedback workaround was a Apple specific solution as they didn't
support transform feedback. Metal didn't use Compute shaders in
EEVEE-Legacy for performance reasons. Since EEVEE-Next/Workbench-Next
Metal uses compute shaders.
Fixes: #117497
Pull Request: https://projects.blender.org/blender/blender/pulls/117507
The benefits are O(1) access to the string size, clearer ownership,
and easily accessible utility functions. For now, only change functions
where the string is clearly non-null. It's not clear in what cases some
other functions recieve null strings.
* Add documentation / comments
* Apply const where possible to cache_init function codepath
* Minor cleanup of conditionals and initialization
Contains changes that were deferred from #117316
Pull Request: https://projects.blender.org/blender/blender/pulls/117651
- Remove unnecessary use of "shelf" namespace inside that namespace
- Remove unused function declaration
- Don't bother passing a pointer to a pointer to the region data,
that didn't accomplish anything and added unnecessary complexity
Use an optional string instead of a manually allocated char pointer.
Optional is used because sometimes `nullptr` was returned. It's
still inconsistent though, because often "" or ".." was returned
instead.
This was caused by global variable `sound_cfra` not being updated when
rendering sequencer data. This global variable could cause problems in
other cases though, so it is removed. Functions that are used to set
anomation buffers now accept frame as argument.
Pull Request: https://projects.blender.org/blender/blender/pulls/117345
Adds vertex groups and basic operator support to the `GreasePencil` data
block.
Vertex groups in the `GreasePencil` ID are used as the source of truth
for vertex groups names and ordering in the UI. Individual drawings also
have vertex group lists, but they should not be modified directly by
users or the API. The main purpose of storing vertex group names in in a
drawing's `CurveGeometry` is to make it self-contained, so that vertex
weights can be associated with names without requiring the
`GreasePencil` parent data.
Vertex group operators are implemented generically for some ID types.
Grease Pencil needs its own handling in these operators. After
manipulating `vertex_group_names` the `validate_drawing_vertex_groups`
utility function should be called to ensure that drawings only contain a
true subset of the `GreasePencil` data block.
Operators for assigning/removing/selecting/deselecting vertices are also
implemented here. To avoid putting grease pencil logic into the generic
`object_deform.cc` file a number of utility functions have been added in
`BKE_grease_pencil_vgroup.hh`.
Fixes#117337
Pull Request: https://projects.blender.org/blender/blender/pulls/117476
Remove transparency weight from other closure weights.
Since closure weights take transparency into account,
scaling closure colors by their weight applies alpha pre-multiplication to them,
causing dithered transparency materials to be darker than they should be.
Pull Request: https://projects.blender.org/blender/blender/pulls/117675
This change makes it so the OIDN is listening to the node execution
being cancelled, allowing for a more instant user feedback on the
compositor graph changes. It is especially visible when dealing with
4k images, and using pre-filter on the guiding passes.
Similar implementation to what Cycles does.
This change covers tiles and full-frame compositors.
The GPU compositor needs extra work to have this supported.
Pull Request: https://projects.blender.org/blender/blender/pulls/117698