Commit Graph

1361 Commits

Author SHA1 Message Date
Aras Pranckevicius
39150096d8 Fix #121720: OBJ does not import some curves properly
If a curve was not using U parameter range of 0..1, the importer
did not properly detect whether the "U endpoint" flag should
be set on it. Fixed that, along with test coverage for the case.
2024-05-13 11:45:20 +03:00
Lukas Stockner
4a1597e39a Cycles: Add tests for Thin Film in Principled BSDF 2024-05-12 22:29:08 +02:00
Clément Foucault
717f546f91 EEVEE-Next: Increase light threshold
Make tests closer to cycles as the main difference
was the light not going far enough to bounce on
the background.
2024-05-10 19:52:11 +02:00
Clément Foucault
9cb76bd728 Fix: EEVEE-Next: Fix crashing tests 2024-05-10 19:49:21 +02:00
Sergey Sharybin
7b4232e8aa Compositor: Move Execution Mode and Precision from bNodeTree to Scene
This allows to expose these settings in the Performance panel in the
render buttons. Also moves compositor-specific options away from the
generic node tree structure.

For the backwards-compatibility the options are still present in the
DNA for the bNodeTree. This is to minimize the impact on the Studio
which has used the GPU compositor for a while now. They can be
removed in a future release.

There is no functional changes expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/121583
2024-05-10 18:08:33 +02:00
Falk David
40a739e800 Cleanup: Formatting 2024-05-10 17:58:56 +02:00
Bastien Montagne
7629182c62 Unittests: blendfile versioning: Add Link and Append basic tests.
These are really basic testing as well, merely linking or appending the
first collection or object in all processed blendfiles. But it should
help catching 'rare' issues in linking/appending from older blendfiles.
2024-05-10 16:00:30 +02:00
Bastien Montagne
3c14067ecd Unittests: 'versioning' py test: generate multiple instances to parallelize it.
The `io_blendfile_versioning` test is currently one of the slowest
(excluding Cycles ones) in debug builds, it can easily take several
minutes to complete.

This commit split it into several instances, each processing a subset of
all the blendfiles.

This gives a strong speed-up when only running that specific test.
As expected, speedup is neglectable when running the whole test suite
though.

| instances | debug  | release | debug all* | release all |
| --------- | ------ | ------- | ---------- | ----------- |
|         1 | 190.95 |   19.39 |     439.54 |       63.51 |
|         4 |  61.80 |    6.81 |        N/A |         N/A |
|         8 |  38.33 |    5.14 |     435.00 |       58.93 |
|        16 |  33.97 |    4.16 |        N/A |         N/A |
|        32 |  46.54 |    5.14 |        N/A |         N/A |

Times are in seconds.
`instances` are the number of tests generated (1 is same as before this
commit).
The first two columns are timings for running the versioning test only,
the last two are timings for the full test suite (excluding Cycles tests
in the debug build case).
2024-05-10 16:00:30 +02:00
Aras Pranckevicius
7970915dc9 Tests: Add VSE test for text strip blurred shadow / outline options 2024-05-09 16:33:11 +03:00
Habib Gahbiche
6f2afc7390 Fix #121436: Compositor: 2d Stabilization translates image when set to bicubic
The node uses multiple transform operations, each using its own sampling. Using bicubic sampling in the translate node causes undesired offsets.

These changes were intentional (see test updates in `c4e1be73`), but the offsets were thought to be too small for users to notice.

Pull Request: https://projects.blender.org/blender/blender/pulls/121495
2024-05-07 21:08:28 +02:00
Clément Foucault
0b7985a58b EEVEE-Next: Increase shadow precision in render tests 2024-05-07 15:07:40 +02:00
Attila Áfra
205b909669 Build: Upgrade OIDN to 2.3.0-beta
This updates OIDN to 2.3.0-beta. The final version is planned to be
released in time for Blender 4.2 Beta. The most relevant changes:

1. Much higher quality when denoising with accurate prefiltering in *high*
   quality mode, but at the cost of lower performance (use *balanced*
   quality mode to revert to previous *high* quality mode)
2. Added new *fast* quality mode for 1.5-2x higher performance viewport
   denoising
3. Lazy device module loading to avoid potential stability issues caused by
   drivers of unused devices
4. Release CUDA primary context as soon as the OIDN device gets destroyed
   to prevent potential memory leaks

To enable 2 and 3, code changes are needed in Blender, to be committed
separately.

Ref #118455

Pull Request: https://projects.blender.org/blender/blender/pulls/121359
2024-05-06 14:14:58 +02:00
Jesse Yurkovich
7dae89d276 USD: Add test to cover import of mesh attributes
Adds a test to validate the import of Mesh attributes for USD.

It reuses the recently added export attribute test file to generate the
USD file to load.

The test validates the current behavior in `main`. Missing data and bugs
are noted in comments and can be addressed afterwards.

Pull Request: https://projects.blender.org/blender/blender/pulls/121327
2024-05-02 03:57:25 +02:00
Jacques Lucke
9758d5fe90 Geometry Nodes: add regression tests for some newer nodes 2024-05-01 23:18:21 +02:00
Habib Gahbiche
c4e1be73b6 Tests: Update compositor tests related to translate operation
Changes were made in https://projects.blender.org/blender/blender/pulls/119603
2024-05-01 15:06:09 +02:00
Omar Emara
382131fef2 Realtime Compositor: Implement Fast Gaussian blur
This patch implements the Fast Gaussian blur mode for the Realtime
Compositor. This is a faster but less accurate implementation of
Gaussian blur.

This is implemented as a recursive Gaussian blur algorithm based on the
general method outlined in the following paper:

 Hale, Dave. "Recursive gaussian filters." CWP-546 (2006).

In particular, based on the table in Section 5 Conclusion, for very low
radius blur, we use a direct separable Gaussian convolution. For medium
blur radius, we use the fourth order IIR Deriche filter based on the
following paper:

  Deriche, Rachid. Recursively implementating the Gaussian and its
  derivatives. Diss. INRIA, 1993.

For high radius blur, we use the fourth order IIR Van Vliet filter based
on the following paper:

  Van Vliet, Lucas J., Ian T. Young, and Piet W. Verbeek. "Recursive
  Gaussian derivative filters." Proceedings. Fourteenth International
  Conference on Pattern Recognition (Cat. No. 98EX170). Vol. 1. IEEE,
  1998.

That's because direct convolution is faster and more accurate for very
low radius, while the Deriche filter is more accurate for medium blur
radius, while Van Vliet is more accurate for high blur radius. The
criteria suggested by the paper is a sigma value threshold of 3 and 32
for the Deriche and Van Vliet filters respectively, which we apply on
the larger of the two dimensions.

Both the Deriche and Van Vliet filters are numerically unstable for high
blur radius. So we decompose the Van Vliet filter into a parallel bank
of smaller second order filters based on the method of partial fractions
discussed in the book:

  Oppenheim, Alan V. Discrete-time signal processing. Pearson Education
  India, 1999.

We leave the Deriche filter as is since it is only used for low radii
anyways.

Compared to the CPU implementation, this implementation is more
accurate, but less numerically stable, since CPU uses doubles, which is
not feasible for the GPU.

The only change of behavior between CPU and this implementation is that
this implementation uses the same radius, so Fast Gaussian will match
normal Gaussian, while the CPU implementation has a radius that is 1.5x
the size of normal Gaussian. A patch to change the CPU behavior #121211.

Pull Request: https://projects.blender.org/blender/blender/pulls/120431
2024-05-01 09:57:30 +02:00
Omar Emara
f595345f52 Compositor: Match size of Fast Gaussian with Gaussian
This patch matches the size of the Fast Gaussian mode of blur with the
standard Gaussian mode. The sigma value was computed as half the radius,
while it should be third of the radius, since Blender's Gaussian
function is truncated at 3 of the standard deviation of the unit
Gaussian. The patch include versioning to adjust the size of existing
files.

Pull Request: https://projects.blender.org/blender/blender/pulls/121211
2024-05-01 09:01:53 +02:00
Clément Foucault
303f91a09c EEVEE-Next: Add slab thickness and thickness from shadow options
Implement the design discussed in #120384.

This adds two parameters. One for changing the approximation
method, and another to use the thickness from shadow map.

We pack the former in the gbuffer by dividing the 16bits
used for thickness by two and use one bit to store the
method.

The thickness from shadow map is now decoupled from the
light evaluation shader. This makes it more performant and
compatible with ray-tracing. This commit also uses the
same biases as shadow mapping to avoid aliasing artifacts
(fix #119339).

This refactors the light evaluation quite a bit to
remove unused bits bits and make the whole transmission
light evaluation without too much complexity.

Pull Request: https://projects.blender.org/blender/blender/pulls/121171
2024-04-30 20:32:46 +02:00
Omar Emara
208a612c54 Compositor: Add GPU tests for bicubic interpolation 2024-04-30 19:11:55 +03:00
10c00b6390 Anim: Add RNA enum for animation bindings + operator to un-assign
Add an RNA enum property `AnimData.animation_binding` that lists all the
bindings available in `AnimData.animation`.

The list of bindings is filtered to only contain the bindings suitable
for the animated ID. This prevents assigning a 'camera' binding to a
mesh.

Un-assigning is done via an operator, represented as an 'X' button in
the interface.

The enum property contains up to two special items:
- "New" to create a new binding for the ID.
- "(none/legacy)" to indicate that this ID doesn't have a binding
  assigned. This one is conditional, and only appears when it is
  necessary.

These two special items are experimental, and mostly exist because we're
still evaluating things and building a better UI. It is intended that
the binding selector will become as close to the ID selector as
possible.

-----------

Note that this PR also contains #121268 as it builds up from that one, and I didn't want to wait with testing on the buildbot until that one lands.

The new Baklava panel:

![image](/attachments/ac357f32-d50a-481b-8b3c-9c0be07424b6)

Pull Request: https://projects.blender.org/blender/blender/pulls/121269
2024-04-30 17:37:16 +02:00
c41f1be5b7 Anim: RNA, refuse to set AnimData.binding_handle when there is no animation
Refuse to set the RNA property `AnimData.animation_binding_handle` when
`AnimData.animation` is nil.

When in a hypothetical future `AnimData.animation` would be set, the
binding handle would be ignored anyway, as it's only meaningful within
the context of a known animation. Refusing to set the binding handle in
cases where it is known to be meaningless may help to find bugs in
Python scripts.

Pull Request: https://projects.blender.org/blender/blender/pulls/121268
2024-04-30 16:24:31 +02:00
David Murmann
ee51f643b0 Cycles: Ray Portal BSDF
Transport rays that enter to another location in the scene, with
specified ray position and normal. This may be used to render portals
for visual effects, and other production rendering tricks.

This acts much like a Transparent BSDF. Render passes are passed
through, and this is affected by light path max transparent bounces.

Pull Request: https://projects.blender.org/blender/blender/pulls/114386
2024-04-29 12:37:51 +02:00
Jesse Yurkovich
16a29a7a75 USD: Add test to cover export of mesh attributes
Adds a test to validate the export of Mesh attributes for USD.

It tests that all domains and types for a Mesh object are written to the
USD file correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/121180
2024-04-28 03:53:20 +02:00
Jesse Yurkovich
211ad352af USD: Add new test file for mesh/curve attributes 2024-04-27 17:46:32 -07:00
Clément Foucault
e209e43146 EEVEE-Next: Update clamp tests 2024-04-23 12:01:31 +02:00
Christoph Lendenfeld
8a8921e7a8 Anim: Add unit tests for keying custom properties
This PR adds unit tests for the "Custom Properties" option in the User Preferences.
It checks that the correct properties are keyed but not others.

Pull Request: https://projects.blender.org/blender/blender/pulls/120422
2024-04-23 09:36:38 +02:00
Habib Gahbiche
a652543568 Tests: Compositor: add bilinear and bicubic tests 2024-04-22 21:40:20 +02:00
Brecht Van Lommel
192d0790eb Tests: Update render references for EEVEE/Workbench/Storm 2024-04-19 16:51:09 +02:00
Clément Foucault
c6cdb3c3cc EEVEE-Next: Update test file for refraction light 2024-04-19 14:01:00 +02:00
Campbell Barton
06adfcaf38 Cleanup: unused imports 2024-04-19 16:09:30 +10:00
Clément Foucault
addb02f239 EEVEE-Next: Bump surfel density for tests
This was really under sampling and some of the
differences between platforms might have come
from this.
2024-04-15 19:55:02 +02:00
1315991ecb Anim: add keytype argument to keyframe_insert() RNA function
Add an optional keyword argument `keytype` to the
`rna_struct.keyframe_insert()` function.

This makes it possible to set the new key's type. The code for this was
almost all in place, the only thing that was missing was the RNA
wrapper, which is what this commit adds.

Example: `bpy.context.object.keyframe_insert("location",
keytype='JITTER')`

There is no backward compatibility issue here, because the argument is
optional and defaults to the previously hardcoded value of `KEYFRAME`.

Pull Request: https://projects.blender.org/blender/blender/pulls/120578
2024-04-15 11:36:38 +02:00
Clément Foucault
d8d6925bc7 EEVEE-Next: Update render test files with suboptimal settings 2024-04-15 11:10:17 +02:00
Campbell Barton
d5f837a8ee Cleanup: remove redundant string formatting 2024-04-12 10:04:07 +10:00
Iliya Katueshenock
6bafe65d28 Mesh: Calculate edges with VectorSet instead of Map
Due to legacy reasons (`MEdge`), edge calculation was being done with
idea that edges cannot be temporarily copied. But today, edges are just
`int2`, so using `edge *` instead of `edge` actually made things worse.
And since `OrderedEdge` itself is the same thing as `int2`, it does not
make sense to use `Map` for edges. So, now edges are in a hash set.
To be able to take index of edges, `VectorSet` is used.

The only functional change now is that original edges will be reordered
as well. This should be okay just like an unintentional but stable
indices change.

For 2'000 x 2'000 x 2'000 cube edges calculation, change is around
`3703.47` -> `2911.18` ms.

In order to reduce memory usage, a template parameter is added to
`VectorSet` slots, so they can use a 32 instead of 64 bit index type.
Without that, the performance change is not consistent and might not be
better on a computer with more memory bandwidth.

Co-authored-by: Hans Goudey <hans@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/120224
2024-04-11 04:33:25 +02:00
Omar Emara
26f059ae55 Realtime Compositor: Support variable scaling
This patch adds support for variable scaling in the Scale node for the
Realtime Compositor. This is supported for the CPU compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/120314
2024-04-09 16:02:47 +02:00
13f3a81842 Anim: allow assigning Animation data-blocks
Expand the `AnimData` struct with an `Animation *` + an
`binding_stable_index` field, and properly handle those relations.

This also adds functionality for actually pointing animated IDs to
`Animation` data-blocks, and automatically hooking up the relevant
`Binding`.

The Depsgraph code is extended to take these new relations into account,
but doesn't trigger any animation evaluation yet.

For more info, see #113594.

Pull Request: https://projects.blender.org/blender/blender/pulls/118677
2024-04-08 12:53:32 +02:00
38878b4ac2 Anim: add Animation data-block management functions
Add code (including RNA wrappers) for:

- Creating, removing, and accessing `Animation` data-blocks.
- Creating and removing layers, strips, and bindings on those `Animation`
  data-blocks.
- Accessing those via RNA.

Note that this does not include assignment to any animated data-block,
so it is of limited practical use.

For more info, see #113594.

Pull Request: https://projects.blender.org/blender/blender/pulls/118677
2024-04-08 12:53:32 +02:00
Sergey Sharybin
040855654f Cycles: Add various light tree tests 2024-04-08 12:22:36 +02:00
Omar Emara
15e8159cbd Compositor: Update test for GPU Vector Blur node 2024-04-05 17:20:18 +02:00
Omar Emara
50c92c29ef Compositor: Update Fire2 test to be more useful
It relied on the old clipping behavior of the Translate node, so rewrite
the nodes to produce a result similar to the old one.
2024-04-05 15:22:43 +02:00
Omar Emara
b229d32086 Compositor: Port GPU Vector Blur to CPU
This patch ports the GPU Vector Blur node to the CPU, which is in turn
ported from EEVEE. This is a breaking change since it produces different
motion blur results that are more similar to EEVEE's motion blur.
Further, the Curved, Minimum, and Maximum options were removed on the
user level since they are not used in the new implementation.

There are no significant changes to the code, except in the max velocity
computation as well as the velocity dilation passes. The GPU code uses
atomic indirection buffers, while the CPU runs single threaded for the
dilation pass, since it is a fast pass anyways. However, we impose
artificial constraints on the precision of the dilation process for
compatibility with the atomic implementation.

There are still tiny differences between CPU and GPU that I haven't been
able to solve, but I shall solve them in a later patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/120135
2024-04-05 09:48:03 +02:00
Sergey Sharybin
9efb8329a1 Cycles: Add regression test for light linking and mesh lights 2024-04-03 11:29:40 +02:00
Hans Goudey
03cc78de31 Tests: Add modifier tests for shrinkwrap target normal project
This code didn't have regression tests yet. Add tests for #120051,
with meshes with and without boundary edges.
2024-03-29 10:11:22 -04:00
Brecht Van Lommel
0334ce5666 Tests: Update references for EEVEE, Workbench, Storm 2024-03-28 16:29:26 +01:00
Omar Emara
db13fc01ad Compositor: Unify Defocus node between CPU and GPU
This patch unifies the Defocus node between the CPU and GPU compositors.
Both nodes now use a variable sized bokeh kernel which is always odd
sized for a center pixel guarantee. Further the CPU implementation now
properly handles half pixel offsets when doing interpolation, and always
sets the threshold to zero similar to the GPU implementation.
2024-03-28 14:35:13 +02:00
Omar Emara
042c50b65f Compositor: Unify Bokeh Image node between CPU and GPU
This patch unifies the CPU and GPU implementation for the Bokeh Image
node. The bokeh is now evaluated at the center of pixels and allows
different sizes for the output kernel.
2024-03-28 13:23:58 +02:00
Weizhen Huang
68253b4937 Fix: Cycles volume light tree using wrong point to compute uncertainty angle
it is not clear from which point the `cos_theta_u` should be computed in
volume segment, so the original implementation was mixing the closest point
and the point where the minimal angle is formed.
Use the closest point on segment as a conservative measure.

Pull Request: https://projects.blender.org/blender/blender/pulls/119965
2024-03-27 15:06:05 +01:00
Omar Emara
4d9678c483 Fix: Sun Beams node is off by half a pixel
The Sun Beams node is off by half a pixel. That's because we add a half
pixel offset to the initial coordinates, but then sample the texture
with the half pixel. To fix thus, use the texture_bilinear_extend
utility to sample the image, which takes care of the half pixel offset.
2024-03-27 12:49:21 +02:00
Omar Emara
5ae5614d1e Fix: Chroma Key differs from reference implementation
The GPU compositor Chroma Key node differs from the reference
implementation. This is caused by a typo, where the acceptance angle was
halved after computing tangent instead of before computing it.
2024-03-27 11:10:49 +02:00