Commit Graph

133575 Commits

Author SHA1 Message Date
Philipp Oeser
663c1ea14d Merge branch 'blender-v4.1-release' 2024-02-26 17:16:33 +01:00
Philipp Oeser
ae022e515b Fix 104657: crash when trying to create a Pivot Constraint for armature
`RootPChanMap` will be nullptr when building DEG object-level
constraints (as as opposed to bone constraints where this map is built
prior), and in that case we don't need to check for the common chains in
`bone_target_opcode`.

Thx @sergey for additional confirmation

Pull Request: https://projects.blender.org/blender/blender/pulls/118745
2024-02-26 17:15:58 +01:00
Clément Foucault
c04eb58134 EEVEE-Next: Make denoising roughness correct for refraction
Avoid overblurred refractions.

Fix #110760
2024-02-26 16:21:08 +01:00
Jeroen Bakker
8dce2a422b EEVEE-Next: Specialization Constants for Film Accumulation
On lower end hardware the film accumulation has bad performance. Sometimes
upto 10ms. This PR improves the performance somewhat by adding a
specialization constant around the renderpasses that are actually needed for
rendering, the number of samples and if reprojection is enabled.

`enabled_categories`: Based on the enabled render passes some outer loops are
enabled/disabled that handle the specific render passes. This improves the performance
as no memory will be reserved for branches that are never accessed.

`samples_len` & `use_reprojection`: GPU compilers tend to optimize texture fetches
when they to the outer loop. This is only possible when the inner loop can be unrolled.
In the case of the film accumulation the inner loop couldn't be unrolled. By adding a
specialization constant would allow unrolling of the inner loop.

On old or low-end devices the improvement is around 40%. On newer devices
the improvement is 50+%. Performance of this shader is similar to
the godot.

| GPU                  | Before | New   |
|----------------------|--------|-------|
| NVIDIA GTX 760       | 3.5ms  | 2.4ms |
| GFX1036 (RDNA2 iGPU) | 9.9ms  | 6.2ms |
| AMD Radeon Pro W7500 | 2.1ms  | 0.9ms |

Pull Request: https://projects.blender.org/blender/blender/pulls/118385
2024-02-26 16:19:26 +01:00
Jeroen Bakker
e5b9bbe0ae Draw: Add support for uint specialization constants
When implementing film accumulation specialization constants we came
across a missing implementation for uint as specialization constant.
This is a split-off from the original patch to add support for uint.

When using it is important to compile with asserts on. uint can be casted
to int without knowning. There are assert mechanism that point you to
these cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/118750
2024-02-26 16:18:09 +01:00
Hans Goudey
bace4c9a29 Mesh: Improvements to position and normal draw extraction
Currently there are two vertex buffers that contain mesh normals. First, the
normals are extracted and stored interleaved with positions. Then there is
a second vertex buffer for just normals. Interleaving them makes some
sense, since they change together, but it fights with the contiguous storage
benefits of `Mesh` and generally makes code more difficult to optimize.

This PR removes the normals interleaved with the positions and changes
the code for extracting positions and normals from meshes to be simpler
and faster, mainly by not using the "extract iterators" as described by the
#116901 design task. That moves most of the branching outside of hot
loops, so we don't do the same work for every mesh element. This also
gives us the option of not calculating or extracting normals in more
situations like wireframe display in the future.

This is only a small part of the work for #116901, so the state of the code
after this PR will have more design inconsistencies. I'll keep working to
resolve those in the future.

In general I observed at least a 5-40% improvement in FPS in playback
of files with large meshes.

Pull Request: https://projects.blender.org/blender/blender/pulls/116902
2024-02-26 16:01:14 +01:00
Sebastian Parborg
203d3e0d40 Linux: Don't always enable the CPU checker
When building a non portable build or when not using the precompiled
libraries, do not enable the CPU checker.

Make the cmake configure step error out when building with
WITH_STRICT_BUILD_OPTIONS if the LIBDIR can not be found.

Pull Request: https://projects.blender.org/blender/blender/pulls/118519
2024-02-26 15:41:22 +01:00
Omar Emara
43f45f3986 Merge branch 'blender-v4.1-release' 2024-02-26 16:29:28 +02:00
YimingWu
3d1cdfe2ca GPv3: Line Art Modifier
This is a migration of the current Line Art modifier to GPv3.

Note:
- The modifier is using the exact same DNA structure as the old one, it's re-defined in a different name. At the moment all the variable names and placement after the `ModifierData` part should stay exactly the same until we do proper versioning of the modifier data and completely remove the GPv2 support.
- Vertex weight transfer feature no longer supports name initial matching ("group" used to match "group1","group2" etc). Now it will only transfer vertex weight from source vertex groups that has the exact same name as specified.

Pull Request: https://projects.blender.org/blender/blender/pulls/117028
2024-02-26 15:28:15 +01:00
Omar Emara
a2ca050087 Fix #118711: Crash in compositor with many nodes
The Viewport Compositors crashes when there are many nodes that are not
connected to the compositor or viewer outputs.

That's because those sockets were wrongly added to the shader operation,
even though they will not be used, which surpasses the limit for the
maximum image units per shader.
2024-02-26 16:24:38 +02:00
Clément Foucault
038fc84ab3 EEVEE-Next: Add light support for refraction closures
This adds support by just reusing the GGX reflection LTC
look-up table. This avoid more memory usage for another
table.

This is quite a hack and has no real physical ground.
We already have a roughness remapping function for
reusing sphere-probe for refraction and matching the
blur level. We can reuse this function and use it
for sampling the reflection LUT.

Then getting the theta LUT parameter is done by
computing the angle between the refraction direction
and the reversed normal.

This works because the table is parametrized using the
angle between the view vector and the normal. This angle
is the same as the angle between the reflection vector
and the normal. So to get the equivalent lobe in the
refraction direction we get the angle between the
refraction direction and the reversed normal.

Note: This has issues shadow-map tagging but it should
be fixed separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/118589
2024-02-26 15:20:16 +01:00
Julian Eisel
0995adce20 Fix asset catalogs test failure
Unit tests were assuming that creating a catalog from a path would not
create catalogs for the parent path elements if missing. I'd argue this
should not be unit tested since it's internal behavior that isn't
visible to API users. But for now I'll keep the test working as is, also
to avoid indirect recursive calls of `create_missing_catalogs()`.
2024-02-26 15:12:38 +01:00
Jeroen Bakker
3109564825 GPU: Fix shader compilation Metal
Metal uses an union to store the `gl_WorkGroupSize` the union needs to
be unpacked. We first unpack to uvec3 before in order to work around an
NVIDIA driver bug.

Issue introduced by: e3ac2ac93e6ffdf704adad93a9f59ec2c716989f

Pull Request: https://projects.blender.org/blender/blender/pulls/118749
2024-02-26 14:51:21 +01:00
Thomas Dinges
2b095c97fa Cycles: Increase minimum target on x86 to SSE4.2
* Compile regular host code with SSE4.2
* Remove the SSE2 kernel, only the SSE4.2 and AVX2 kernel remain

Pull Request: https://projects.blender.org/blender/blender/pulls/118471
2024-02-26 14:49:19 +01:00
Brecht Van Lommel
f9e8f2d857 Tests: Update EEVEE renders for motion blur and roughness changes 2024-02-26 14:46:44 +01:00
Jeroen Bakker
582be5e315 Cleanup: Make format 2024-02-26 14:44:56 +01:00
Julian Eisel
13e93ac7f1 Tools: Don't include commits authored by others in weekly report script
So far this would include commits committed by the given user, but
authored by someone else. Unfotunately we can't use email addresses to
filter these out, since we can't get the email addresses associated with
an account from gitea, or do a user lookup by email. In my testing the
commit author email and the publicly visible account email would
mismatch in most cases.
2024-02-26 14:29:32 +01:00
Brecht Van Lommel
065ba92c54 Merge branch 'blender-v4.1-release' 2024-02-26 14:08:07 +01:00
Brecht Van Lommel
95f48fe7b8 Build: Add missing git-lfs package for Rocky 8 setup 2024-02-26 13:59:53 +01:00
Aras Pranckevicius
12ef5d38c4 Merge branch 'blender-v4.1-release' 2024-02-26 14:54:35 +02:00
Aras Pranckevicius
b846ccd76b Fix #118501: crash opening some projects if Load UI is off
Missing vecscope_rgb null initialization when loading Scopes data,
introduced in 567455124d
2024-02-26 14:54:05 +02:00
Bastien Montagne
e22034da3c Merge branch 'blender-v4.1-release' 2024-02-26 13:06:07 +01:00
Bastien Montagne
8b0d59c476 I18N: Updated UI translations from git/weblate (db64de8fc876). 2024-02-26 13:05:07 +01:00
Jeroen Bakker
e3ac2ac93e GPU: Shaders fail to compile on NVIDIA
NVIDIA fails with segmentation fault when compiling shaders due to recent changes.
This PR tweaks the shader code to work around the segmentation fault.

Issue introduced by: 7f43699ebf50a7c1f4d8432529ea3cfe2abb78f9

Pull Request: https://projects.blender.org/blender/blender/pulls/118744
2024-02-26 13:01:10 +01:00
Jacques Lucke
d45e6ab0a1 Cleanup: add fmtlib dependency in some modules
This makes it easier to just use e.g. `fmt::println` in these modules.
2024-02-26 12:53:35 +01:00
Miguel Pozo
1446b05ca4 Merge branch 'blender-v4.1-release' 2024-02-26 12:51:59 +01:00
Miguel Pozo
a106ff9f56 Fix #118634: EEVEE: Set clip threshold per material
Pull Request: https://projects.blender.org/blender/blender/pulls/118681
2024-02-26 12:49:29 +01:00
Julian Eisel
2a08055066 Tools: Don't include merge commits in weekly report script output
These don't add any useful information to reports, they are just noise.
2024-02-26 12:09:30 +01:00
Julian Eisel
7032933094 Tools: Improve PR headings in weekly report script
"Pull" is a weird/confusing term, just use the proper name "Pull
Request".
2024-02-26 11:57:08 +01:00
Julian Eisel
57db30ce75 Tools: Correct formatting of PRs in weekly report script
Match the formatting of commits.
2024-02-26 11:52:48 +01:00
Julian Eisel
df8706a9af Tools: Fix missing PR reviews in weekly reports script
The script would only include PRs that were commented on as "reviewed",
not PRs that were either approved or had changes requested.
2024-02-26 11:13:04 +01:00
Julian Eisel
2bfaf94fa7 Refactor: Lazy create & update asset catalog trees
Rebuilding the tree immediately after changes could cause the tree to be
rebuilt multiple times. More importantly, it made it harder to reason
about thread safety, since we would touch the tree within a whole bunch
of API functions. Now tree building is simplified and managed in a
single place, so making the tree building thread safe can be made
trivially in a follow-up.

Note, this means the initial catalog tree building doesn't happen in a
background thread together with loading the asset library and catalogs
anymore. But we would already do all further rebuilds on the main thread
anyway, this shouldn't have any notable impact.
2024-02-26 10:35:15 +01:00
YimingWu
e938b516a9 Fix #118425: LineArt: ensure long edges are shown
Line art used to not calculate edges where both ends are outside image
frame, this will lead to missing edges in some cases where the model is
scaled up pretty big. Now it ensures those edges are still preserved.

Pull Request: https://projects.blender.org/blender/blender/pulls/118448
2024-02-26 04:50:48 +01:00
YimingWu
0a339231ec Fix #118547: LineArt: Handle shadow segments with 0 length
Line art shadow projection will cut lines indefinitely when it
encounters a edge segment with 0 length. In the case of #118547, it was
caused by the combination bevel modifier and the view angle. This fix
ensures that no such edge is worked on further.

Pull Request: https://projects.blender.org/blender/blender/pulls/118613
2024-02-26 03:53:21 +01:00
Campbell Barton
a5ef7ac3bd Merge branch 'blender-v4.1-release' 2024-02-26 12:02:26 +11:00
Gangneron
462c144f41 Text Editor: add support for GLSL syntax highlighting
The objective is to be able to create your own GLSL shaders in Blender.
This improves the workflow since all shader programming can be done
directly in Blender. In addition, the GLSL language is a very popular
language in the video games industry and even in general.

Ref !116793

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
2024-02-26 11:57:41 +11:00
Campbell Barton
a8cc6bb75b Cleanup: spelling in comments 2024-02-26 10:23:52 +11:00
Campbell Barton
5db2a842c0 Unbreak build with GLIBC pre 2.28
Also de-duplicate rename logic for Linux & other UNIX systems.
2024-02-26 10:15:54 +11:00
Eugene Kuznetsov
7f43699ebf DRW: Curves: Indexbuf optimization for large numbers of curves
This optimizes a few loops that become significant bottlenecks during
viewport rendering of scenes with large numbers of curves.

To render a curves object, Blender needs to generate a potentially
very large (but trivial) index buffer. As previously implemented,
this index buffer is generated in an extremely inefficient manner,
with a single-threaded loop and an explicit function call per entry.
The buffer then needs to be pushed onto the GPU, which is also a fairly
slow task.

The PR generates the index buffer directly on the GPU with compute
shader.

Pull Request: https://projects.blender.org/blender/blender/pulls/116617
2024-02-25 17:22:58 +01:00
Jacques Lucke
9a3ceb79de BLI: add weighted parallel for function
The standard `threading::parallel_for` function tries to split the range into
uniformly sized subranges. This is great if each element takes approximately
the same amount of time to compute.

However, there are also situations where the time required to do the work for
a single index differs significantly between different indices. In such a case,
it's better to split the tasks into segments while taking the size of each task into
account.

This patch implements `threading::parallel_for_weighted` which allows passing
in an additional callback that returns the size of each task.

Pull Request: https://projects.blender.org/blender/blender/pulls/118348
2024-02-25 15:01:05 +01:00
Campbell Barton
91895bf806 Unbreak build with GLIBC pre 2.28
Also de-duplicate rename logic for Linux & other UNIX systems.
2024-02-25 22:56:22 +11:00
Pratik Borhade
2bad37a219 GPv3: Active layer poll
This is required to avoid execution of operator and disable them in UI when
object has no active layer (this is same as legacy GP)

Pull Request: https://projects.blender.org/blender/blender/pulls/118609
2024-02-25 08:19:59 +01:00
Pratik Borhade
7ae8e1dc07 GPv3: Select strokes by material operator
Port legacy gp operator `GPENCIL_OT_material_select`

Pull Request: https://projects.blender.org/blender/blender/pulls/118652
2024-02-25 08:18:58 +01:00
Jesse Yurkovich
0a2544f2e8 Merge branch 'blender-v4.1-release' 2024-02-24 15:03:01 -08:00
Jesse Yurkovich
0f266ca3c9 Fix #118704: STL batch export used wrong filename
The newly generated filename for batches was not used.

Pull Request: https://projects.blender.org/blender/blender/pulls/118708
2024-02-25 00:01:33 +01:00
Bastien Montagne
3dc0bc27d3 GPv3: Conversion: Copy over FakeUser and IDProperties.
When creating a new GreasePencil ID from an existing bGPdata legacy ID,
also copy FakeUser flag, and the IDProperties.
2024-02-24 20:26:12 +01:00
Bastien Montagne
f2eab300b7 Core: IDRemapp: Allow remapping mismatching ID types.
While this should not be allowed in most cases, in some (e.g.conversion
between different ID types), this is actually a valid operation.
2024-02-24 20:19:55 +01:00
Harley Acheson
311e0270dd UI: Improvements to Confirmation of Pack Resources
A more informative confirmation dialog to confirm that the user wishes
to pack resources.

Pull Request: https://projects.blender.org/blender/blender/pulls/117155
2024-02-24 01:42:20 +01:00
Harley Acheson
5eda7c9fd3 UI: Improvements to Confirmation of Apply Modifier
A more informative confirmation dialog to confirm that the user wishes
to apply modifier to an object with multiple users.

Pull Request: https://projects.blender.org/blender/blender/pulls/117156
2024-02-24 01:38:34 +01:00
Harley Acheson
2c8a3243ee UI: Improvements to Confirmation of Apply Transforms
A more informative confirmation dialog to confirm that the user wishes
to apply transforms to an object with multiple users.

Pull Request: https://projects.blender.org/blender/blender/pulls/117157
2024-02-24 01:32:53 +01:00