Commit Graph

142599 Commits

Author SHA1 Message Date
Omar Emara
53fa6f0d0a Compositor: Implement Map Value node for new CPU compositor
Reference #125968.
2024-10-22 17:43:17 +03:00
Omar Emara
278787aeee Compositor: Implemenet Map Range node for new CPU compositor
Reference #125968.
2024-10-22 17:42:28 +03:00
Omar Emara
1bd64e873e Fix: Corrupt image when compositor is canceled
When the compositor is canceled mid-execution, the image node will get
corrupt in future executions in new CPU execution mode. That's because
the image node treated cached images as an intermediate results that can
be passed through, while they should be treated as external resources
since they are managed by the static cache manager.

This patch fixes that by adding another variant of wrap_external that
takes a Result and wraps its data, then we use that in the Image node.
2024-10-22 17:37:30 +03:00
Weizhen Huang
60b8fd005d Merge branch 'blender-v4.3-release' 2024-10-22 15:38:48 +02:00
Weizhen Huang
afd629bffc Cycles: make switching of sampling techniques in Draine less noticeable
Draine phase function sampling internally use Henyey-Greenstein and
Rayleigh sampling for degenerated cases, but the sampling pattern was
different between Draine and Rayleigh. The commit effectively replace
`rand` with `1 - rand` in Rayleigh sampling.

Pull Request: https://projects.blender.org/blender/blender/pulls/129261
2024-10-22 15:38:06 +02:00
Weizhen Huang
ee6f27a100 Fix: Cycles: NaN in Draine phase function when g == 0
When `g == 0`, the Draine phase function from
https://doi.org/10.1051/0004-6361/202142437 simplifies to
\[\Phi(\theta)=\frac{3}{4\pi(3+\alpha)}(1+\alpha\cos^2\theta).\]
Similar as Rayleigh sampling in https://doi.org/10.1364/JOSAA.28.002436,
The solution to the CDF of the marginal density function is
\[\cos^3\theta+a\cos\theta+b=0,\]
with
\[a=\frac{3}{\alpha},\quad b=\frac{3+\alpha}{\alpha}(2\xi_1-1),\]
which has only one real root since \(\alpha > 0\),
resulting in the sample technique
\[\cos\theta=u-\frac{1}{\alpha u}.\]

Pull Request: https://projects.blender.org/blender/blender/pulls/129259
2024-10-22 15:37:37 +02:00
Howard Trickey
eba2aff295 Revert "Rob-Blair-ready" - committed before tests ready.
This reverts commit 8b94e21976.
2024-10-22 14:57:56 +02:00
Howard Trickey
8b94e21976 Rob-Blair-ready
Copying PR 126309 from Rob-Blair so that I can try to make the tests pass.

Co-authored-by: Rob-Blair <Rob.Blair@Verizon.net>
Pull Request: https://projects.blender.org/blender/blender/pulls/129313
2024-10-22 14:52:30 +02:00
Omar Emara
c8dd6650db Merge branch 'blender-v4.3-release' 2024-10-22 11:54:27 +03:00
Omar Emara
cce896fe11 Fix #127292: Cryptomatte passes are missing meta-data
Meta-data are missing on Cryptomatte layers in the GPU compositor, so
they do not get saved using the File Output node. This is due to a use
after free error where a temporary string is used in the meta-data
population logic. This is fixed by assigning the string to a temporary
variable instead.

Thanks to Jorn Visser for finding the cause of the issue.
2024-10-22 11:50:04 +03:00
Omar Emara
0bff0cfe0f Compositor: Implemenet Vector Curves node for CPU
This patch implemenets the Vector Curves node for the new CPU
compositor.

Reference: #125968.
2024-10-22 11:37:56 +03:00
Lukas Tönne
71398478b2 Fix #128055: parentinv matrix uninitialized in old GPv2 files
In GPv2 the parentinv matrix is zero initially and only becomes valid
after setting the layer parent. This matrix must not be copied to the
GPv3 layers unless the parent is set.

In addition the parentinv matrix should also be computed when changing
the layer parent. This has been nominally added, except that a full
computation isn't possible without the actual grease pencil Object. This
means a local RNA property cannot update the parentinv matrix, this
needs to become a full-blown operator. The behavior now should be the
same as in GPv2 at least.

Pull Request: https://projects.blender.org/blender/blender/pulls/129304
2024-10-22 09:30:34 +02:00
Sergey Sharybin
97e86f6d72 Merge branch 'blender-v4.3-release' 2024-10-22 09:17:20 +02:00
Sergey Sharybin
a4553aad49 Build: Lower the number of concurrent HIP-RT jobs
This is an attempt to deal with an increased OOM on the buildbot.
2024-10-22 09:15:41 +02:00
Campbell Barton
5955e0566c Cleanup: update use of typing for tools/utils 2024-10-22 16:44:21 +11:00
Campbell Barton
0ae9ae736e Merge branch 'blender-v4.3-release' 2024-10-22 15:58:37 +11:00
Campbell Barton
f69fbb41c1 Fix #129225: Crash in modifiers & constraints with invalid enum values
Even though this is generally avoided, drivers don't prevent
invalid values being set. Further files from branches or files
written in the future may contain enum values not yet known.

Resolve by range checking enum values which are used to index arrays.
2024-10-22 15:56:58 +11:00
Campbell Barton
07880dd369 Merge branch 'blender-v4.3-release' 2024-10-22 13:20:24 +11:00
Campbell Barton
414b9fb96f Merge branch 'blender-v4.3-release' 2024-10-22 13:20:20 +11:00
Campbell Barton
1d6add574d Fix #129167: Operator search can hang for some operator names
RNA label & description truncation could cause invalid UTF8
which caused BLI_string_search to hang.

Resolve by ensuring truncation of RNA descriptions & labels never
truncates a multi-byte sequences.

The issue with BLI_string_search would still be good to resolve but can
be handled separately.
2024-10-22 12:47:39 +11:00
Campbell Barton
40b5a4da2b Fix misleading assertion message setting built-in operator values 2024-10-22 12:46:39 +11:00
Clément Foucault
c81745e4af Fix: Overlay: Shader test broken on Mac
The merge got wrong.
2024-10-21 22:17:55 +02:00
Jesse Yurkovich
79d468fe6b Cleanup: Use compile-time format string type for OBJ and PLY writing
The `fmtlib` text formatting library, when compiled in C++20 onwards,
requires that the incoming format string is a compile-time constant so
it's able to perform type checks against it[1]. The change here ensures
it can do so.

While we're not set to go to C++20 any time soon, this is a backwards
compatible change that can be done today and allows us to focus on the
harder fmt-related issues later.

No change in performance or functionality was observed.

[1] https://godbolt.org/z/qG5dsf7YG

Pull Request: https://projects.blender.org/blender/blender/pulls/129272
2024-10-21 21:20:43 +02:00
Clément Foucault
db56bcdbe9 Merge branch 'blender-v4.3-release'
# Conflicts:
#	source/blender/draw/engines/overlay/overlay_next_curve.hh
#	source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh
2024-10-21 19:19:35 +02:00
Clément Foucault
4a83a58c82 Fix: DRW: Make submit without manager sync still valid
Fixes assert triggering during EEVEE render test.
2024-10-21 19:16:55 +02:00
YimingWu
5fff95f519 Fix: Grease Pencil: Add back support for stroke direction overlay
Since GPv3 shader currently uses particle strand/points shader, we
need to modify that slightly to display the grease pencil overlays.

This adds the missing `vflag` attribute to the edit gpencil batch.

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/128116
2024-10-21 18:47:24 +02:00
Clément Foucault
3035fd1c36 GPencil: Port geometry shader to primitive expansion API
This removes the need for the geometry shader and the
workaround path for Metal.

Note that creating 2 batches for each stroke might become
a bottleneck in bigger scenes. But currently the bottleneck
is always be the fill algorithm. It can be optimized further
if needed.

Rel #127493

Pull Request: https://projects.blender.org/blender/blender/pulls/129274
2024-10-21 16:25:24 +02:00
Jacques Lucke
8588e196c4 Merge branch 'blender-v4.3-release' 2024-10-21 15:48:06 +02:00
Jacques Lucke
7c7b8e1f28 Fix #129087: don't show empty panels in geometry nodes modifier
If a panel is detected to be empty, it is hidden automatically now.
This is the same behavior as in group nodes.
2024-10-21 15:47:16 +02:00
Jacques Lucke
b5eb379e81 Merge branch 'blender-v4.3-release' 2024-10-21 15:34:27 +02:00
Jacques Lucke
84ffe3720d Fix #129217: crash when switching geometry nodes to tool mode with active viewer
The viewer does not work without a context and the context is derived from `snode.id`.
2024-10-21 15:33:21 +02:00
Jason Fielder
4408628a94 Fix: Metal: Resource leak when closing before all compilation batches have finished.
Addresses the case when Blender is shutdown before the
parallel compiler has finished processing all the shader batches.
The parallel compiler destructor will now attempt to terminate all
of the outstanding batches and free the shaders.

Authored by Apple: James McCarthy

Pull Request: https://projects.blender.org/blender/blender/pulls/129172
2024-10-21 14:58:50 +02:00
Aras Pranckevicius
7567c07480 Merge remote-tracking branch 'origin/blender-v4.3-release' 2024-10-21 15:45:12 +03:00
Aras Pranckevicius
28ea1d2f7b Fix: VSE scopes crash on float images
Regression since a904db3ee7 ("skip no-op colorspace transforms for
float images"), the newly added do_display_buffer_apply_no_processor
function did not handle case of both source and destination being
float images. This happens when VSE produces a float image, and
you turn on a Waveform scope.

Pull Request: https://projects.blender.org/blender/blender/pulls/129293
2024-10-21 14:43:56 +02:00
Omar Emara
8b8ab301a4 Cleanup: Clarify Cryptomatte layer identification 2024-10-21 15:32:19 +03:00
Jacques Lucke
d7368e0068 Cleanup: remove unused variable 2024-10-21 14:29:04 +02:00
Arye Ramaty
b686e72e57 Fix: wrong offset in the 'Has Neighbour' output of the 'Index of Nearest' node
The first encounter wasn't counted for, which resulted in a bias of one
(vertices with single neighbor return false), I initialized the counting from
1 instead of zero which seems to solve the problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/129021
2024-10-21 14:21:41 +02:00
Jacques Lucke
e67d7355f2 Merge branch 'blender-v4.3-release' 2024-10-21 14:19:58 +02:00
Jacques Lucke
21a24cf82b Fix #129263: improve measured node execution times
Measure the times of nodes and zones more explicitly in more cases instead
of relying on adding up smaller measurements.
2024-10-21 14:13:28 +02:00
Falk David
3075bd3f2c Merge branch 'blender-v4.3-release' 2024-10-21 14:12:40 +02:00
Falk David
83e562aad4 Fix #129247: GPv3: Removing material doesn't remap some materials correctly
The issue was that the code that remaps the materials for when
a slot is removed was returning when the `material_index` attribute
didn't exist instead of continuing the loop over all drawings.

This issue was present both in `BKE_grease_pencil_material_remap`
and `BKE_grease_pencil_material_index_remove`
but `BKE_grease_pencil_material_remap` forced the `material_index`
attribute to be created, which meant that the early return
was never hit.

The fix fixes both issues:
* Continue instead of return.
* Don't create the `material_index` attribute in `BKE_grease_pencil_material_remap`
  if it doesn't exist.

Pull Request: https://projects.blender.org/blender/blender/pulls/129288
2024-10-21 14:11:11 +02:00
Falk David
b05e9f7bd6 Fix #127523: Missing update when updating positions with Python
The issue was that the strokes were not using the `POLY` type and
needed to be tagged.

This adds a function `tag_positions_changed` on the `GreasePencilDrawing`
so that the high-level python API can tag the positions if
the `point.position` attibute is written to.

Pull Request: https://projects.blender.org/blender/blender/pulls/129292
2024-10-21 14:10:32 +02:00
Alaska
d92ee66889 Fix #128905: Clarify EEVEE volumetric shadows tool tip
Make the tool tip for the volumetric shadow option in EEVEE
easier to understand.

Pull Request: https://projects.blender.org/blender/blender/pulls/128918
2024-10-21 14:08:24 +02:00
Clément Foucault
46c452dfc3 GPU: Remove shader builder
There is no need for this complexity anymore
as we now have the shader unit tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/129014
2024-10-21 14:00:12 +02:00
Clément Foucault
20d09435ab DRW: Add split visibility and command generation function
This adds the possibility to the user code to
group visibility and command generation compute
dispatch together to reduce the overhead of
PSO and pipeline switch.

This PR also make passes that have been submitted
(i.e.: that generated commands) as read-only.

This allows to automatically remove redundant
command generation when submitting the same
pass with the same view multiple times, or,
remove redundant visibility calculation for the
same view in multiple passes. This automation
is done for the common usage of the API (using `submit`).

Custom usage (using `submit_only`) needs to abide by
the rule of the API and update visibility and commands
when required.

Pull Request: https://projects.blender.org/blender/blender/pulls/129170
2024-10-21 13:32:54 +02:00
Jacques Lucke
cc202bbe1c Merge branch 'blender-v4.3-release' 2024-10-21 13:24:07 +02:00
Jacques Lucke
f729d98fa4 Fix #129269: can't load images packed into the .blend file
The issue only happened when compiling with clang which
apparently evaluated the parameters in a different order.

`IMB_steal_encoded_buffer` sets `ibuf->encoded_size` to 0.
2024-10-21 13:13:58 +02:00
Campbell Barton
64027cd178 Merge branch 'blender-v4.3-release' 2024-10-21 22:00:40 +11:00
Campbell Barton
c836c0a20e Fix #129151: Crash showing tool-tips from dynamic enums
Duplicate descriptions for dynamic enum menu items to resolve
use-after-free error.
based on !129008.

Ref !129164

Co-authored-by: Julian Eisel <julian@blender.org>
2024-10-21 21:59:13 +11:00
Falk David
dd3e338c79 Formatting 2024-10-21 12:50:09 +02:00