Commit Graph

120055 Commits

Author SHA1 Message Date
Clément Foucault
95996737c3 EEVEE-Next: Remove support for renderpass for forward opaque objects
This make the feature set harder to understand from a user
perspective. This removes a lot of code complexity.
2024-04-16 20:08:29 +02:00
Clément Foucault
5b1f5a5aa7 Cleanup: DRW: Remove uneeded dependency of debug shaders on draw_view
This fix a missing bind error for the debug draw
and print shaders.
2024-04-16 19:47:39 +02:00
Clément Foucault
d2df694439 EEVEE-Next: DoF: Avoid out of bound access in scatter vertex shader
As noted in the comment, it is very unlikely to happen.
But since we can run into undefined behavior if it does
better make the access safe.
2024-04-16 19:30:21 +02:00
Bastien Montagne
420508b235 Fix (unreported) LibOverride: Assert when clearing a liboverride.
The viewlayer was not properly ensured to be synced after a remapping in
the operator code.
2024-04-16 19:12:56 +02:00
Bastien Montagne
003489c693 Fix #120701: Overrides: Running Make Override operator in viewport without a selection created duplicates.
Forbid running liboverride operators when there is an active but not
selected object. Code is not designed to handle this case.
2024-04-16 19:12:56 +02:00
Bartosz Kosiorek
b1fb8eccb4 UI: Add tooltips to inputs of Color shader nodes
Pull Request: https://projects.blender.org/blender/blender/pulls/119576
2024-04-16 19:07:08 +02:00
Hans Goudey
2685c666ec Cleanup: Sculpt: Use C++ Set and Array for geodesic distances
Pull Request: https://projects.blender.org/blender/blender/pulls/120708
2024-04-16 18:43:31 +02:00
Hans Goudey
4fcc8f2320 Cleanup: Use FunctionRef for sculpt flood fill callback 2024-04-16 18:43:29 +02:00
Hans Goudey
8546449582 Cleanup: Sculpt: Move flood fill struct to namespace 2024-04-16 18:43:29 +02:00
Bastien Montagne
4dc53709b2 Fix #120703: Overrides: Missing 'override' Color overlay for some UI widgets.
Outliner's 'Restrictions' set of icon buttons would not show the
'liboverridden' teal-blue background.
2024-04-16 18:38:39 +02:00
Bastien Montagne
c3ee098c78 Fix #120655: GPv3: Conversion: invalid handling of generated 'offset radius' nodetree.
Previous code would re-create a node-tree everytime conversion code was
called (on main file read, but also on all link/append operations).

Worse, it would assing a local generated nodetree to converted linked
GPv3 objects.

This commit solves both issues in a similar way as what was done for the
legacy mesh 'auto smooth' generated node tree.

It also slightly refactors the conversion code by adding a single struct
containing all 'runtime' conversion data (two mappings currently). This
struct is then passed to internal conversion functions as reference.
2024-04-16 18:01:15 +02:00
Bastien Montagne
f465943872 Cleanup: GPv3 conversion: Remove unused public functions.
Not sure why, several functions exclusively used internally by the GPv3
conversion code were exposed in its header, made them static now.
2024-04-16 18:01:15 +02:00
Bastien Montagne
ddb2519339 BKE mesh legacy conversion: use new BKE_node_tree_add_in_lib when needed.
The creation of a special nodegroup for the legacy 'auto smooth'
conversion used to handle 'setting the library' part itself.

Use instead the recently introduce `in_lib` variants of ID creation API.

On top of simplifying the code, this commit also fixes 'linked'
generated nodetrees always getting a `.001` suffix added to their names.
2024-04-16 18:01:15 +02:00
Bastien Montagne
fda3900722 BKE node: Add a new in_lib function to create nodetrees within a library.
While not common, some places of the code (like readfile versionning)
may have to generate new IDs for linked data.
2024-04-16 18:01:15 +02:00
Miguel Pozo
cec57e9138 Fix: Draw: EEVEE-Next shadow flickering and other uninitialized bounds fixes
Always check if the DrawManager ObjectBounds are valid.
Initialized invalid bounds to NaN in debug builds for easier debugging.

Pull Request: https://projects.blender.org/blender/blender/pulls/120591
2024-04-16 17:19:13 +02:00
Julian Eisel
19dbcf5fc1 Assets: Speed up iterating over asset libraries
Essentially this avoids the file browser entry cache mechanism for when
we only want the list of assets, and don't need the preview image. The
speedup should become bigger the bigger the asset library is, see #120494.

When iterating over assets, we would do that through the `AssetHandle`
type, which is just a wrapper around a cached file in the file browser
backend (for historic reasons). So first we'd have to ensure this entry
is actually cached, which involved some lookups and a bunch of
allocations, which would easily add up.

In fact, for as long as we don't need the asset-handle (usually to get
the preview), we have the needed data easily available already, without
requiring a cached file in the file browser backend.

See the pull request for benchmark results.

Pull Request: https://projects.blender.org/blender/blender/pulls/120699
2024-04-16 17:08:49 +02:00
Aras Pranckevicius
9962c50b54 BLI: factor out BLI_path_has_hidden_component, fix it and speed it up
Factors out utility function "does the path contain any hidden file/folder
components?" function out of innards of UI code (edit_file,
is_hidden_dot_filename) into a BLI function BLI_path_has_hidden_component
and then:
- Adds unit test coverage to it, which uncovered some inconsistencies
- Fix the behavior inconsistencies:
  - A path component that is just a dot (.), was not considered hidden.
    Unless it was the first folder component (now this is fixed).
  - A path component that ended in a tilde (~) was considered hidden.
    Unless it was the first folder component (now this is fixed).
- Speedup the function by not doing several recursive scans over the
  string; instead all the logic is done in a single string scan.

Synthetic HasHiddenComponents_Performance test: 6.0s -> 1.1s for 50M calls
on Mac M1 Max.

More real world test (setup as in #120494): out of whole build_catalog_tree
time, the time taken by BLI_path_has_hidden_component drops from 37% down
to 28%

Pull Request: https://projects.blender.org/blender/blender/pulls/120541
2024-04-16 16:51:31 +02:00
Germano Cavalcante
5b7bc88571 Revert "Refactor: Select Engine: Draw actual indices instead of 'Original Indices'"
This reverts commit 157c4cfbc1.

Functions like `DRW_select_buffer_bitmap_from_circle` and
`DRW_select_buffer_bitmap_from_poly` need to be adapted too.
2024-04-16 10:22:52 -03:00
Hans Goudey
fda57f8e84 Fix: Vertex normal calculation broken in array modifier
Mistake in 6023a6a423
2024-04-16 09:14:50 -04:00
Brecht Van Lommel
07922a99e9 UI: Tweaks to collection export
* Remove embossing from preset / export / delete buttons.
   For example modifiers also don't have emboss for X, and presets
   never do. So it seems consistent.
* Remove duplicated preset buttons, only have the one in the header
  like other panels in properties editor.
* Use property separate layout without boxes for file path.
* Show info message when exporting a single or all collections,
  otherwise it's not obvious that something happened when clicking
  the button.

Pull Request: https://projects.blender.org/blender/blender/pulls/120667
2024-04-16 15:02:33 +02:00
Germano Cavalcante
157c4cfbc1 Refactor: Select Engine: Draw actual indices instead of 'Original Indices'
The selection engine renders `uint` texture where each element of the
geometry is represented as an index.

When the geometry have modifiers, the original index was used for the
texture.

However this is not necessary for the select engine to work. The real
mesh indexes can be used in the texture and, only at the end, the
original index can be retrieved on the CPU itself.

Advantages of this approach:
- Optimizes the code to generate selection buffers.
- Makes the select id texture more informative as it identifies the
  real elements instead of the original ones.

Pull Request: https://projects.blender.org/blender/blender/pulls/119977
2024-04-16 14:58:01 +02:00
Jason Fielder
05cd235f90 FIX: EEVEE Next Non-shadowing directional light hang
Resolves GPU hang caused by erroneous processing of
directional lights which should not cast shadows.
Resolves GPU hang with the Tree Creature asset and
could possibly resolve #120038.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/120696
2024-04-16 14:57:07 +02:00
Jeroen Bakker
f789619e65 Vulkan: Share descriptor set layouts between shaders
Previously all shaders had its own descriptor set layout handle. This makes it
difficult to see if currently bound resources can be reused when switching shaders.
To work around this limitation, the vulkan backend rebound the resources over
and over again.

This PR is part of the render graph where changing shaders can reuse previous
bound resources. This PR only makes sure that the layout handles are the same
so we can identify 'compatible' pipelines. The behavior to limit rebinding of
resources will be added as part of the render graph in a later commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/120562
2024-04-16 14:00:49 +02:00
Jacques Lucke
d1634b2a4a UI: support adding a search weight to menu entries for menu-search
The goal is to support better search experience in the cases where we want to
explicitly influence the ordering instead of relying only on general heuristics.
We used to support this already at some point I think, but not anymore since we
started using menu-search.

The implementation is fairly straight forward. It mainly just forwards the
search weight from the menu definition to the search code through various
required steps. The main annoying thing is that changing the signature of e.g.
`uiItemFullO_ptr` is fairly involved. Even using default parameters for these
functions is a bit annoying and becomes fairly unreadable and error-prone on the
call-site. For now, I worked around this by storing the search weight on the
`uiLayout` and to copy it to the `uiBut` from there. That seems preferable until
we have a better solution for adding parameters to all the `uiItem*` functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/120572
2024-04-16 12:18:45 +02:00
Omar Emara
757da9dbc1 Cleanup: Remove redundant compositor arguments
The compositor execute functions have a `rendering` argument to specify
if the compositor is executing as part of the render pipeline. But the
render context argument is null if we are not rendering, so the
`rendering` arguement is redundant and can be removed.

Additionally, we no longer use use_file_output as a hack to detect
rendering.

Pull Request: https://projects.blender.org/blender/blender/pulls/120659
2024-04-16 09:11:39 +02:00
Omar Emara
2cf8b5c4e1 Compositor: Improve interactivity for GPU compositing
This patch improves the interactivity of the GPU compositor for
interactive node tree edits by waiting on GPU work to finish to support
more granular canceling.

This does have a performance penalty, but it does not affect final
rendering and it seems worth it because even though it is slower it will
feel faster for users.

Pull Request: https://projects.blender.org/blender/blender/pulls/120656
2024-04-16 09:10:36 +02:00
Campbell Barton
ad48827244 Fix duplicate gpencil_sculpt_tool property in PAINT_OT_brush_select
Operator properties must be unique, this caused a warning generating
Python API docs.
2024-04-16 16:10:37 +10:00
Campbell Barton
e4529592d6 Cleanup: sort cmake file-lists 2024-04-16 12:28:38 +10:00
Campbell Barton
20b0805213 Cleanup: use const pointers where possible 2024-04-16 12:27:47 +10:00
Iliya Katueshenock
6fc6bcdb82 Cleanup: Unused function
Today unused part of 2cb3677557

Pull Request: https://projects.blender.org/blender/blender/pulls/120682
2024-04-16 00:59:16 +02:00
Clément Foucault
626959ed21 EEVEE-Next: UI: Light-Probe panels
Cleanup pass on light-probe panel.

I tried to put properties in hierarchical order
with frequency of use in mind.

Pull Request: https://projects.blender.org/blender/blender/pulls/120616
2024-04-15 23:39:27 +02:00
Harley Acheson
3c7d015ca8 Refactor: Remove blf_str_offset_to_cursor Else After Return
Removal of unnecessary Elses after Returns in blf_str_offset_to_cursor.

Pull Request: https://projects.blender.org/blender/blender/pulls/120678
2024-04-15 22:57:52 +02:00
Iliya Katueshenock
f01e6d59ec Cleanup: Geometry Nodes: Prevent unnecessary template instantiations
Add utility function to handle supported types explicitly.
Right now Blur Attribute node generates all the attribute types except for bool.
So, there is redundant instances of functions for types:
float2, int2, int8_t, ColorGeometry4b, math::Quaternion, float4x4.
These types are not supported and should not be used for instantiation.
This makes the blender binary 42 KB smaller.

Pull Request: https://projects.blender.org/blender/blender/pulls/120639
2024-04-15 22:04:30 +02:00
Clément Foucault
6623e16001 EEVEE-Next: Change volume probe sample positioning
In order to improve blending of volume probes in a runtime free manner,
we need to introduce a 1 voxel padding around the volume probe data.
This offsets the actual positioning of the samples in the volume grid.

Rel #118725

Pull Request: https://projects.blender.org/blender/blender/pulls/120668
2024-04-15 21:57:31 +02:00
Iliya Katueshenock
2cb3677557 Geometry Nodes: Rewrite Scale Elements node
Rewrite of Scale Elements. Main changes related with removing unnecessary
abstractions (like structures of fields). Next, by using grouping approach,
all data is represented as spans. This provide ability to unify code for
different domains. Using of general utils like IndexMask, Group processing
and array utils provides much more parallelism and better memory usage.
In result, this refactoring result in 4-10 average speed improvement in
attached benchmark file with different probability and scale of elements.

See the PR for more before/after timing information and a benchmark file.

Pull Request: https://projects.blender.org/blender/blender/pulls/115142
2024-04-15 21:55:37 +02:00
Harley Acheson
ddec0740d6 BLF: Better Specification of CJK Font Unicode Coverage
For our built-in fonts (in our stack) we specify the Unicode page
coverage that they support, to avoid loading fonts unnecessarily to see
if they have a particular character.  This way we skip over fonts to
get to symbols, etc. With our CJK (Chinese, Japanese, Korean) font
though we are using the supplied coverage bit values, which includes
more than we want. We only want to load this font for CJK-related pages
to ensure that we use more tailored fonts for other specific languages
and uses later in the font stack.

Pull Request: https://projects.blender.org/blender/blender/pulls/120676
2024-04-15 21:37:40 +02:00
Hans Goudey
75804f2dd0 Fix #120575: GPU subdivision ignores split normals from sharp edges
Fall back to CPU subdivision when there are split edges and the mesh
normals domain is face corners. This is required because splitting the
normals on faces adjacent to sharp edges doesn't work well with the
performance requirements of GPU subdivision.

This is related to 1111903416

Pull Request: https://projects.blender.org/blender/blender/pulls/120674
2024-04-15 21:19:54 +02:00
Harley Acheson
a6b79d7763 BLF: Ignore Combining Characters for Mouse Selection
When we iterate through glyph bounding boxes, we should ignore
combining characters, those without an advance. These types of
characters are placed over top of others, like for diacritical marks.
We never have a need to consider these, only for the parent glyph.
Otherwise mouse insertion of text cursor can occur at the wrong
location, at the edge of a diacritical mark.

Pull Request: https://projects.blender.org/blender/blender/pulls/120675
2024-04-15 21:19:04 +02:00
Harley Acheson
b38f27ae10 Refactor: BLF Offset from Cursor Position Early Exits
BLF function blf_str_offset_from_cursor_position returns the character
offset in a string given a horizontal cursor position. It currently has
no early exits, but can do so for no string or empty string. For negative
position values (so left of the string), do not exit out with zero but
instead act as if it were zero to ensure we test against the first glyph,
which might not be part of the character.

Pull Request: https://projects.blender.org/blender/blender/pulls/120673
2024-04-15 20:50:23 +02:00
Jacques Lucke
c4f1c4d882 Fix #120650: crash when using viewer node in curves sculpt mode
The issue was that `OVERLAY_sculpt_curves_cache_populate` assumes
that the object is a curves object, which was not always the case. Now this
is checked a bit more explicitly.

The solution is still not ideal, because now the cage overlay is not shown
at all when the viewer node is used and the result is something else than
curves, but that needs to be solved separately.
2024-04-15 20:06:59 +02:00
Damien Picard
abc0bf814f UI: Fix and improve a few messages
- "Log Encoding with Chroma inset and rotation": add "of primaries" in
  the description of the AgX Log color space to better explain the
  operation, based on wording in !106355.
- Remove a few double spaces.
- Make Line Art title case everywhere, to convey it's the system /
  brand / product name and not the generic concept.
- "Copy Absolute coordinates or Normal vector" -> "of Normal Vector":
typo.
- "Makes a link between selected output in input sockets" ->
  "Make...", "output and input": typo.
- "Purge Unused Data From This File" -> "from this": title case as per
  HIGs.
- GPencil -> Grease Pencil: no reason to use an abbreviation here.
- "Around Current Frame" -> "Around Frame": actual name of the
  onion-skinning method.
- "... (layer height for layer tool, i.e.)" -> "(i.e. the layer height
  for the layer tool)": put "i.e." at the start of the sentence.
- Expand description of toe-in stereo camera option.
- "Children collections their parent-collection-specific settings" ->
  "Children collections with their...": typo.
- "Generate vertex weights base on..." -> "based on" : typo, lower
  case.
- Expand description of GP modifier properties, based on their mesh
  counterparts.
- "AEnvelope" -> "Envelope": typo.
- "Falloff type the feather" -> "of the feather": typo.
- "usually make transition as long as effect strip": rephrase.
- "When disabled a users extensions directory is created" -> "a
  user's": typo.
- "successfull" -> "successful": typo.
- "Remove all attributes... a single wildcard (*).": remove trailing
  ".".
- "..., use "Save Preferences."": remove trailing ".".

Some issues reported by Marina Veselkova and Tamar Mebonia.

Pull Request: https://projects.blender.org/blender/blender/pulls/120649
2024-04-15 20:02:38 +02:00
Bastien Montagne
0a7510ebaa Fix #116818: Unlinking an Object in the Scene Collection unlinks all linked objects
Code was assuming that if an object had a Scene parent ID (in Outliner
context), Outliner was in Scene view and object had to be removed from
whole scene.

However, in ViewLayer view, in case an object is in a Scene's main
collection, its parent item is the scene.
2024-04-15 18:42:45 +02:00
Bartosz Kosiorek
dc35737b69 Fix: Move CFL Number parameter for Fluid into Adaptive Time Steps
The CFL Number is only used when Adaptive Time Steps is enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/120666
2024-04-15 18:39:36 +02:00
Harley Acheson
aae8b956dd Refactor: BLF Extract Function BLF_str_offset_to_cursor
Move into own BLF function, code that returns a text cursor (caret)
position given a string offset. This code is currently just in
interface_widgets.cc but should be a separate BLF function.

Pull Request: https://projects.blender.org/blender/blender/pulls/120622
2024-04-15 18:29:25 +02:00
Jacques Lucke
188123c9ad Fix #111394: crash when deleting node group with active viewer nested inside
The case when the tree-path of a node editor is out of date is handled more
gracefully now. Generally, one should also look into eagerly updating the
tree-path in this case, but that can be done separately.
2024-04-15 18:09:32 +02:00
Jacques Lucke
bd72562ff9 Geometry Nodes: handle matrix to rotation conversion more gracefully
Previously, this conversion would often result in invalid quaternions or
hit an assert in `normalized_to_quat_fast`. It's not super nice to convert
to euler as an intermediate step performance wise, but it seems to be
the easiest solution for now. Extracting rotations from matrices should
not be done all that often anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/120568
2024-04-15 18:04:19 +02:00
Miguel Pozo
65d9311291 Fix: EEVEE-Next: Shadow Ray accumulation
Fix when ray_count > 1.
Regression from 77638a6.
2024-04-15 16:40:59 +02:00
Brecht Van Lommel
67582ed337 Fix: MaterialX export of Noise Texture colored for Fac output
Fixes blender/blender-addons#105266

Pull Request: https://projects.blender.org/blender/blender/pulls/120661
2024-04-15 15:23:26 +02:00
Aras Pranckevicius
e2e6b977a6 Cleanup: Remove pre-SSE4 fallbacks in BLI pixel interpolation functions
Commit 8b9743eb40 already made Blender be compiled with SSE4.2 flags
on x64 architecture, which kicked in the SSE4 code paths in
BLI_math_interp functions.

Which made them faster, e.g. in VSE on Windows/Ryzen5950X, scaling
up an image to 4K resolution:
- Bilinear 5.8ms -> 5.3ms
- Cubic Mitchell 16.3ms -> 15.7ms

This change removes the now-unneeded SSE pre-SSE4 code paths for
_mm_floor_ps, _mm_min_epi32 and _mm_max_epi32 emulation.

Additionally, including BLI_simd.h on SSE4 platform now includes
the necessary SSE4 intrinsics header.

Pull Request: https://projects.blender.org/blender/blender/pulls/120583
2024-04-15 15:21:58 +02:00
Campbell Barton
904d51d6cb RNA: use boolean for function callbacks & "valid" iterator state
Integers were used when the value is logically a boolean.

Ref !120130
2024-04-15 23:04:38 +10:00