Commit Graph

106814 Commits

Author SHA1 Message Date
Hans Goudey
c07132b43b Cleanup: Make format 2024-02-14 17:43:03 -05:00
Hans Goudey
c4d0e88e6e Fix: Asset browser crash after recent cleanup
After 57586df687. Turns out the library can be null here.
2024-02-14 17:41:17 -05:00
Hans Goudey
b9ed6ce0a5 Refactor: Various C++ improvements to collection property search
- Use FunctionRef to avoid passing a separate user_data pointer
- Use std::string in arguments struct
- Add search items in one loop after gathering search items
- Use Vector of unique_ptr for search items instead of linked list
2024-02-14 17:23:01 -05:00
Hans Goudey
61e61ce0e1 Cleanup: Use Span instead of Vector const reference
Span is preferrable since it's agnostic of the source container,
makes it clearer that there is no ownership, is 8 bytes smaller,
and can be passed by value.
2024-02-14 17:23:01 -05:00
Hans Goudey
a24d6e7012 Cleanup: Use StringRef instead of StringRefNull
The called function here only needs StringRef, that can apply here too.
2024-02-14 17:23:01 -05:00
Hans Goudey
aef0b6552b Cleanup: Use helper functions to access next and previous face corners 2024-02-14 17:23:01 -05:00
Hans Goudey
57586df687 Cleanup: Remove unnecessary asset system functions
These functions appear to be thin wrappers around the C++ classes
that previously weren't accessible in C code.
2024-02-14 17:23:01 -05:00
Hans Goudey
7098e53c61 Cleanup: Use "this" keyword to access class methods 2024-02-14 17:23:01 -05:00
Iliya Katueshenock
faf056f17b Cleanup: Move mesh utility to create mesh without attributes
Mesh with no attributes is used to build new mesh from scratch.
Some data can be shared, so there is no reason to have allocated attributes.

Pull Request: https://projects.blender.org/blender/blender/pulls/118297
2024-02-14 23:14:12 +01:00
Sergey Sharybin
33af56f13e GPU Compositor: Avoid global DST lock on Linux
It is not required to hold the lock of DST when performing
compositing on GPU, as the compositor implementation uses the
GPU module directly, bypassing the draw manager.

However, currently this is known to cause issues on macOS,
and is not yet tested on Windows.

On Linux it works correctly, and avoids lock while compositor
is running.

There could still be a small locking hiccup, when the GPU
context is created and disposed. This needs to be looked
into.

Pull Request: https://projects.blender.org/blender/blender/pulls/118286
2024-02-14 19:30:38 +01:00
Clément Foucault
7b328390f4 Cleanup: EEVEE-Next: Remove unused mip level in remap shader 2024-02-14 18:52:58 +01:00
Clément Foucault
da72cdee5e EEVEE-Next: Add compute shader to downsample sphere probe
This has no functional change except that it might speed
up probe updates since only updated pixels are processed.

Ref #118256
2024-02-14 18:52:58 +01:00
Hans Goudey
1c3c1e7776 Cleanup: Simplify asset metadata copy function
Also move the destructor declaration to be consistent with the style guide.
2024-02-14 12:06:56 -05:00
Harley Acheson
48dee674f3 UI: Changes to Menu Separator Padding
Add interior horizontal padding to menu separator lines.

Pull Request: https://projects.blender.org/blender/blender/pulls/118227
2024-02-14 17:14:17 +01:00
Hans Goudey
a52323d711 Cleanup: Move BKE_duplilist.hh to C++ 2024-02-14 10:51:46 -05:00
Hans Goudey
ed0be291c8 Cleanup: Use float4x4 matrix type in volume displace modifier 2024-02-14 10:51:46 -05:00
Clément Foucault
f20425bc4c Fix: EEVEE-Next: Missing Volume Probe update after world update 2024-02-14 16:24:02 +01:00
Hans Goudey
1c0f374ec3 Object: Move transform matrices to runtime struct
The `object_to_world` and `world_to_object` matrices are set during
depsgraph evaluation, calculated from the object's animated location,
rotation, scale, parenting, and constraints. It's confusing and
unnecessary to store them with the original data in DNA.

This commit moves them to `ObjectRuntime` and moves the matrices to
use the C++ `float4x4` type, giving the potential for simplified code
using the C++ abstractions. The matrices are accessible with functions
on `Object` directly since they are used so commonly. Though for write
access, directly using the runtime struct is necessary.

The inverse `world_to_object` matrix is often calculated before it's
used, even though it's calculated as part of depsgraph evaluation.
Long term we might not want to store this in `ObjectRuntime` at all,
and just calculate it on demand. Or at least we should remove the
redundant calculations. That should be done separately though.

Pull Request: https://projects.blender.org/blender/blender/pulls/118210
2024-02-14 16:14:49 +01:00
Clément Foucault
bdd15e827f Fix: EEVEE-Next: Crash in bake caused by motion blur
Motion blur needs to be disabled for volume probe baking.
2024-02-14 15:55:36 +01:00
Omar Emara
357d6fcae1 Cleanup: Format 2024-02-14 16:50:20 +02:00
Brecht Van Lommel
aefd930317 Fix: Build error when not using unity build 2024-02-14 15:13:12 +01:00
Clément Foucault
2d08e16601 Cleanup: EEVEE-Next: Split display sync function 2024-02-14 15:09:31 +01:00
Clément Foucault
ee6c7d8eea Fix: EEVEE-Next: Sphere Probe: Wrong world probe index 2024-02-14 15:09:31 +01:00
Jacques Lucke
d27a1c47fa Nodes: hide uneditable input sockets in sidebar
This hides some labels from the sidebar which look a bit out of place.

Pull Request: https://projects.blender.org/blender/blender/pulls/118264
2024-02-14 14:47:07 +01:00
Sergey Sharybin
a8a05ebba1 Compositor: Switch CPU compositor to Full-Frame
The tiled compositor code is mainly still around, which is only
expected to be a short-lived period. Eventually it will also be
removed.

The OpenCL, Group Buffers, and Chunk size options are already removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/118010
2024-02-14 14:23:49 +01:00
Clément Foucault
1f8fac5082 Fix: EEVEE-Next: Broken light baking from script
The G.is_break was not properly set back to false
and the data was never copied back to the original
object.
2024-02-14 13:02:01 +01:00
Sergey Sharybin
2cec7e3aa5 Fix levels node regression in tiled compositor
Caused by previous change for full-frame compositor.

The determine_canvas() is still used by the tiled compositor,
so restore it to the state which makes both compositors to work.

Pull Request: https://projects.blender.org/blender/blender/pulls/118254
2024-02-14 12:02:59 +01:00
Pratik Borhade
dda277e48c Merge branch 'blender-v4.1-release' 2024-02-14 16:22:28 +05:30
Pratik Borhade
f344823785 UI: Opus files not included in sound files filter
Include `.opus` extension in audio filter list

Fixes #118235

Pull Request: https://projects.blender.org/blender/blender/pulls/118238
2024-02-14 11:39:11 +01:00
Pratik Borhade
18912561b5 Fix #118163: Crash hiding face sets with multires
Caused by ce4ec6d42b
Crash occurs due to accessing `corner_tri_faces` when pbvh tpye is
"grid".
Fix is same as 72d324bd81

Pull Request: https://projects.blender.org/blender/blender/pulls/118183
2024-02-14 11:37:11 +01:00
Sergey Sharybin
a1047e0689 Compositor: Make CPU Level node output single value
This aligns the node behavior to GPU compositor.

The implementation is a bit of a stretch of the full-frame
constant-foldable operations, but this is as good as it can
get in a short time.

The alternative could be to somehow inject a SetValue
operation, but since it expects ahead-of-time known value it
is not as straight forward.

Pull Request: https://projects.blender.org/blender/blender/pulls/118248
2024-02-14 10:54:59 +01:00
Campbell Barton
5a86067ff0 Fix build error from duplicate include 2024-02-14 14:27:58 +11:00
Campbell Barton
291ca4ec8e Cleanup: unused variable, redundant strlen call 2024-02-14 13:59:37 +11:00
Campbell Barton
aa6ab9caf9 Cleanup: various non-functional changes for C++ 2024-02-14 13:56:58 +11:00
Campbell Barton
cdc17751ae Cleanup: format 2024-02-14 13:53:36 +11:00
Campbell Barton
1111dff0a6 Tests: improvements to BLI_convexhull_2d_test
The convex hull tests included a reference AABB-fitting function for
comparison which was used to validate the optimized implementation.
This wasn't great as it depended on matching exact return values and
didn't test the logic of AABB-fitting worked usefully.

Replace this with a more general test that creates random polygons with
known bounds, apply a random rotation & translation, then use
AABB-fitting to un-rotate the points, passing when the bounds are no
larger than the size of the generated input.

Details:

- Make BLI_convexhull_aabb_fit_hull_2d a static function again as it was
  only exposed for tests. Use BLI_convexhull_aabb_fit_points_2d instead.
- Remove brute force reference implementation from tests,
  moving this to an assertion within convexhull_2d
  (disabled by default since it's quite slow).
2024-02-14 13:42:14 +11:00
Campbell Barton
3f8cd44485 Cleanup: move BLI_strict_flags.h last, not that it should be kept last
Also add a note in the header why it should be kept last.
2024-02-14 13:40:31 +11:00
Germano Cavalcante
e6e4e6c287 Optimization: avoid calculating the contraint plane when transforming
In most cases, we only need the normal of the plane.

It's a micro-optimization, the difference is very subtle.
2024-02-13 21:21:48 -03:00
Germano Cavalcante
1a74b80d42 Refactor: replace 'isect_ray_plane_v3' with 'isect_ray_plane_v3_factor'
By using `isect_ray_plane_v3_factor` we avoid calculating the v4 plane.
2024-02-13 21:08:49 -03:00
Germano Cavalcante
c9bd326255 Merge branch 'blender-v4.1-release' 2024-02-13 20:35:52 -03:00
Germano Cavalcante
c6e229d3e4 Fix #118221: Snap to Edge with Constraint Plane shifts out of plane
The intersection needs to be calculated with the plane passing through
the snap pivot.
2024-02-13 20:35:08 -03:00
Hans Goudey
5ba6f6d833 Cleanup: Replace typedef keyword in C++ headers 2024-02-13 15:34:32 -05:00
Hans Goudey
7b77c2ebd4 Cleanup: Remove unused 3D view function declaration 2024-02-13 15:00:01 -05:00
Miguel Pozo
2a2effc0c2 Workbench: Share shader cache across instances
Improve instance creation performance by sharing compiled shaders
across instances. (See #114990)

Pull Request: https://projects.blender.org/blender/blender/pulls/118062
2024-02-13 20:56:54 +01:00
Harley Acheson
8fee7c5fc7 UI: Line Under Title for Properties Dialogs
When a popup dialog includes properties, add a line under the title.

Pull Request: https://projects.blender.org/blender/blender/pulls/118051
2024-02-13 20:37:45 +01:00
Hans Goudey
9cf304160b BLI: Add missing overrides to some generic virtual array implementations
The lack of these functions in the "single trivial value" and "sliced
GVArray" implementations caused some code to call fack to the base
class functions. Those are much slower since they involve a virtual
function call per element. For example, this changed the runtime of
creating a new boolean attribute set to "true" on one million faces
from 3.4 ms to 0.35 ms.

Pull Request: https://projects.blender.org/blender/blender/pulls/118161
2024-02-13 19:59:58 +01:00
Clément Foucault
88228a84d1 Fix: EEVEE-Next: Another uninitialized variable in volume probe loading
The spherical_harmonics_triple_product was not working as
expected and produced NaNs.

Cleanup to avoid more confusion.
2024-02-13 19:05:15 +01:00
Clément Foucault
13f0d7bd47 Fix: EEVEE-Next: Uninitialized variable in volume probe loading
The spherical_harmonics_triple_product was not working as
expected and produced NaNs.
2024-02-13 18:59:53 +01:00
Clément Foucault
65d42af3e3 Fix: EEVEE-Next: Broken light capture on emission only materials
This was cause by uninitialized fragment output.
2024-02-13 18:59:53 +01:00
Clément Foucault
6802d87329 EEVEE-Next: Remove DeferredProbeLayer intermediate class
This class is redundant as it is never instanced more
than once.
2024-02-13 18:59:53 +01:00