All probes (including the world background probe) are stored in a single texture. Each probe
can be of any resolution as long as it is a power of 2 and not larger than 2048. So valid options
are (2048x2048, 1024x1024, 512x512, etc).
Each probe can be stored in their own resolution and can be set by the user.
> NOTE: Eventually we would like to add automatic resolution selection.
The probes are packed in an 2d texture array with the dimension of 2048*2048. The number of
layers depends on the actual needed layers. If more layers are needed the texture will be recreated.
This can happen when a new reflection probe is added, or an existing reflection probe is made visible
to the scene or its resolution is changed.
### Octahedral mapping
Probes are rendered into a cubemap. To reduce memory needs and improve sampling performance the cubemap
is stored in octahedral mapping space. This is done in `eevee_reflection_probe_remap_comp.glsl`.
The regular octahedral mapping has been extended to fix leakages at the edges of the texture
and to be able to be used on an atlas texture and by sampling the texture once.
To reduce sampling cost and improve the quality we add an border around the
octahedral map and extend the octahedral coordinates. This also allows us to
generate lower resolution mipmaps of the atlas texture using 2x2 box filtering
from a higher resolution.
### Subdivisions and areas
Probes data are stored besides the texture. The data is used to find out where the probe is stored
in the texture. It is also used to find free space to store new probes.
This approach ensures that we can be flexible at storing probes with different
resolutions on the same layer. Lets see an example how that works
Code-wise this is implemented by `ProbeLocationFinder`. ProbeLocationFinder can view a texture in a
given subdivision level and mark areas that are covered by probes. When finding a free spot it returns
the first empty area.
**Notes**
* Currently the cubemap is rendered with a fixed resolution and mipmaps are generated in order to
increase the quality of the atlas. Eventually we should use dynamic resolution and no mipmaps.
This will be done as part of the light probe baking change.
Pull Request: https://projects.blender.org/blender/blender/pulls/109688
This introduces an alias target `bf::intern::atomic` for
`bf_intern_atomic`. This has the following benefits:
- Any target name with `::` in it will be recognized as an actual
target by cmake, rather than a library name it may not know about.
and will be validated by cmake to exist. Which means if you make
a typo in the LIB section, CMake will error out telling you it
doesn't know about this specific target rather than passing it on
to the build system, where you'll either get build or linker errors
because of said typo.
- Given there is quite a cleanup still to do in the build system,
it won't always be obvious which targets have been updated to
modern targets and which still need to be done. Having a namespaced
target name is a good indicator there.
Pull Request: https://projects.blender.org/blender/blender/pulls/109784
Split off from [#106952: Animation: Butterworth Smoothing filter](https://projects.blender.org/blender/blender/pulls/106952)
This patch allows the slider to take a different string than just "%",
the use case is on #106952 where we want to display "Hz" instead.
Additionally the slider got the ability to set modes, which determine
how the factor number is displayed.
`SLIDER_MODE_PERCENT` means it will multiply by 100 and display as whole numbers
`SLIDER_MODE_FLOAT` means it will display just floats with one digit after the comma
Additionally to that, because the slider range is now arbitrary and potentially deals with
large numbers, the mouse distance needed to travel from min to max has been normalized
to the range.
Pull Request: https://projects.blender.org/blender/blender/pulls/109768
Locked `FCurves` had 2 visual issues
* the dashing is so short it just creates visual noise
* keyframes are drawn in white looking like they are selected
This PR changes this by
* Increasing the dash width
* Keyframes are drawn in black on locked curves
* To indicate that they can't be selected, draw them in a X shape
* To further reduce visual noise, locked curves no longer draw thicker when selected
This is part of the changes discussed in this design task #104867
Pull Request: https://projects.blender.org/blender/blender/pulls/106052
Instead of keeping track of a local array of positions in the modifier
stack itself, use the existing edit mode SoA "edit cache" which already
contains a contiguous array of positions. Combined with positions as a
generic attribute, this means the state is contained just in the mesh
(and the geometry set) making the code much easier to follow.
To do this we make more use of the mesh wrapper system, where we can
pass a `Mesh` that's actually stored with a `BMesh` and the extra
cached array of positions. This also resolves some confusion-- it was
weird to have the mesh wrapper system for this purpose but not use it.
Since we always created a wrapped mesh in edit mode, there's no need
for `MOD_deform_mesh_eval_get` at all anymore. That function was quite
confusing with "eval" in its name when it really retrieved the original
mesh.
Many deform modifiers had placeholder edit mode evaluation functions.
Since these didn't do anything and since the priority is node-based
deformation now, I removed these. The case is documented more in the
modifier type struct callbacks.
Pull Request: https://projects.blender.org/blender/blender/pulls/108637
ebe8f8ce71 and 5669c5a61b added multithreading but
a typo meant it wasn't used for half of the process. Fixing that gives a
30% improvement in my tests, from about 80 to 60 ms converting a grid.
No functional changes.
Previously, each navigation operation had its own method for restoring
the 3D View's state upon cancellation.
However, this approach did not provide significant advantages.
The number of affected variables was too small to justify considering
it for performance optimization, and the cancellation code was
duplicated across different operations.
To address this, the present commit unifies all restore code into a
single function:
- `void viewops_data_state_restore(ViewOpsData *vod);`
As a result, the `viewmove_apply_reset` function has been removed.
Moreover, since the state now has a dedicated restore function, it
seemed appropriate to create a function for capturing the state as
well.
Therefore, the code responsible for capturing the state (previously
scattered within `viewops_data_init_navigation`) has been extracted to
create the function:
- `void viewops_data_state_capture(ViewOpsData *vod);`
During this separation process, a potential error in the code was
identified, where the state may not be fully restored.
Although this issue persists, a comment has been added to clarify this
situation.
Pull Request: https://projects.blender.org/blender/blender/pulls/109760
Hierarchy lines (like we also have in the Outliner) make it easier to
visually parse the hierarchy, and avoid confusion about nesting level.
Especially when some items have icons and/or collapse chevrons and some
not (thus different levels of visual indentation).
They were planned for #93582 and #107881, also see
https://code.blender.org/2023/05/the-next-big-step-grease-pencil-3-0/#layer-groups.
The drawing is implemented as a general tree-view feature, so all
tree-views with collapsable items (which excludes the spreadsheet
data-set tree view) will get them without further setup.
The merging behavior of the Array, Mirror, Screw modifiers has changed
since 4369627e71.
Before, only the customdata of the destination vertex was kept. Source
vertices were completely removed.
With 4369627e71, all vertices in the merge group (whether source or
destination) now have their customdata interpolated.
But this can cause problems for example with the root vertex customdata
of the skin modifier, where if only one of the vertices of the group of
vertices has this flag, the resulting one will also have it.
This commit restores the behavior for the vertices customdata and does
not interpolate it if `do_mix_vert_data` is false.
Pull Request: https://projects.blender.org/blender/blender/pulls/109627
Only do `next++` if `next` is a non-`NULL` pointer. This doesn't change
the functionality of the code, but it does prevent a sanitizer warning.
No functional changes.
The FPS in the viewport is displayed in a string of the form "fps:
%.2f". The string that stores it is of length 16, which is plenty
enough in English. But the translated message in Hindi uses
Devanagari, which takes up 4 bytes per char. Because of this, it is
too long and there is not enough room for the numbers to actually
appear.
To solve this, the containing string length was doubled to 32 chars.
Pull Request: https://projects.blender.org/blender/blender/pulls/109408
Improve 3D text selection & feedback when moving the mouse outside of
the text. Previously mouse selection only worked if the mouse was over
the text, now there is more margin to select characters or lines.
Ref !109229
Co-authored-by: Campbell Barton <campbell@blender.org>
Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
a8a454287a which moved edge creases out of `MEdge` only
retrieved the result data array if the mesh had vertex creases. Before
the processing always happened though. So process the result creases
if the input has edge creases too, and try to retrieve an existing array
instead of always adding a new one.
Add an offset indices utility to do fill constant size new offsets in
parallel, which was already done in the duplicate elements node.
For example, filling poly offsets for a new part of a mesh that is only
quads. In the extrude node this was single-threaded before, so the
new poly offsets is about 10x faster, saving about 10 out of 157 ms
when extruding 2 million faces.
In edit mode the uv map data length gets set to zero. The specialized
MLoopUV code used to have a check to detect this when trying to access
the UVs using foreach_get/set . Add this check for the Attribute code
path as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/109179
This moves the following `editors/*` directories to C++:
- animation, armature, lattice, mesh, metaball, object, scene.
Much of the changes in this commit (inserting casts in particular)
was automated. Further changes like switching to functional style
casts can be done separately by existing automated scripts.
See #103343
Pull Request: https://projects.blender.org/blender/blender/pulls/109715
First we copied the entire BMesh custom data layout to the Mesh, then we
decided not to copy some boolean layers like UV pinning if every value
was false. But that left the layers uninitialized. Instead, copy the
custom data layout _after_ finding which layers to skip.
The utility counts the number of occurrences of each index in an array.
It's used to build offsets for mesh topology maps, or to count the
number of connected elements. Some users are geometry nodes,
the subdivision draw cache, and mesh to curve conversion.
This PR parallelizes the counting to take advantage of multiple
threads. On a Ryzen 7950x, when counting connected edges to
vertices, I observed an improvement from 10.2 to 3.0 ms.
This most likely makes the counting less efficient, but it is
quite a nice performance improvement.
The new code was much slower for me at less than four threads,
so I added a check so that counting remains single threaded in
that case.
Pull Request: https://projects.blender.org/blender/blender/pulls/109628