Commit Graph

1337 Commits

Author SHA1 Message Date
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
Omar Emara
9aa63aa1e8 Fix: Lens Distortion node is off by half a pixel
The Lens Distortion node is off by half a pixel because their normalized
coordinates were at the pixel corners as opposed to their centers, where
this patch changes the behavior to the latter.
2024-03-27 09:04:34 +02:00
Omar Emara
aa208d3d18 Fix: Plane Deform nodes are off by half a pixel
The Plane Track and Corner Pin nodes are off by half a pixel because
their mask is computed at the pixel corners as opposed to their center,
where this patch changes the behavior to the latter.
2024-03-27 08:54:04 +02:00
Omar Emara
7113692206 Fix: Directional Blur node is off by half a pixel
The Directional Blur node is off by half a pixel because it transforms
the pixels at their corner as opposed to their center, where this patch
changes the behavior to the latter.
2024-03-27 08:50:44 +02:00
Omar Emara
6df333a3c7 Fix: Movie Distort node is off by half a pixel
The Movie Distort node is off by half a pixel because it evaluates the
distortion at the corner of pixels as opposed to their center, where
this patch changes the behavior to the latter.
2024-03-27 08:47:07 +02:00
Brecht Van Lommel
2fb4efc905 Fix: GPU test errors importing gpu module
Pull Request: https://projects.blender.org/blender/blender/pulls/119721
2024-03-26 20:16:02 +01:00
Jesse Yurkovich
9ae24fee48 USD: Add tests to cover curve, light, and point instancer import
The curve variations were used during development of the GeometrySet
changes.

The lights and point instancer coverage would have helped uncover bugs
earlier. Bugs that eventually had to be fixed in 4.1. Better late than
never.

The one downside is that the light tests is actually a round-trip test,
which is normally fine to do, except it technically does an export
during the import test.

Pull Request: https://projects.blender.org/blender/blender/pulls/119858
2024-03-26 18:58:46 +01:00
Omar Emara
5764173501 Compositor: Update tests for realtime compositor 2024-03-26 12:52:07 +02:00
Weizhen Huang
2c301c921f Tests: temporarily disable light tree in the new test file
seems to cause problem on other platforms
2024-03-25 19:43:14 +01:00
Weizhen Huang
fdc2962beb Fix #114634: correlated samples in volume when using equiangular sampling and light tree
The same random number was used when sampling from the volume segment
and from the direct scattering position, causing correlation issues with
light tree.

To solve this problem, we ensure the same light is picked for
volume segment/direct scattering, equiangular/distance sampling by
sampling the light tree only once in volume segment. From the direct
scattering position in volume, we sample a position on the picked light
as usual. If sampling from the light tree fails, we continue with
indirect scattering.
For unbiased MIS weight for forward sampling, we retrieve the `P`, `D`
and `t` used in volume segment for traversing the light tree.

The main changes are:
1. `light_tree_sample()` and `light_distribution_sample()` now only pick
lights. Sampling a position on light is done separately via
`light_sample()`.
2. `light_tree_sample()` is now only called only once from volume
segment. For direct lighting we call `light_sample()`.
3. `light_tree_pdf()` now has a template `<in_volume_segment>`.
4. A new field `emitter_id` is added to struct `LightSample`, which just
stores the picked emitter index.
5. Additional field `previous_dt = ray->tmax - ray->tmin` is added to
`state->ray`, because we need this quantity for computing the pdf.
6. Distant/Background lights are also picked by light tree in volume
segment now, because we have no way to pick them afterwards. The direct
sample event for these lights will be handled by
`VOLUME_SAMPLE_DISTANCE`.
7. Original paper suggests to use the maximal importance, this results
in very poor sampling probability for distant and point lights therefore
excessive noise. We have a minimal importance for surface to balance, we
could do the same for volume but I do not want to spend much time on
this now. Just doing `min_importance = 0.0f` seems to do the job
okayish. This way we still won't sample the light with zero
`max_importance`.

The current solution might perform worse with distance sampling, because
the light tree measure is biased towards equiangular sampling. However,
it is difficult to perform MIS between equiangular and distance sampling
if different lights are picked for each method. This is something we can
look into in the future if proved to be a serious regression.

Pull Request: https://projects.blender.org/blender/blender/pulls/119389
2024-03-25 18:50:52 +01:00
Weizhen Huang
082b68fcb9 Cycles: improve equiangular sampling in volume
By restricting the sample range along the ray to the valid segment.

Supports

**Mesh Light**
- [x] restrict the ray segment to the side with MIS

**Area Light**
- [x] when the spread is zero, find the intersection of the ray and the bounding box/cylinder of the rectangle/ellipse area light beam
- [x] when the spread is non-zero, find the intersection of the ray and the minimal enclosing cone of the area light beam
*note the result is also unbiased when we just consider the cone from the sampled point in volume segment. Far away from the light source it's less noisy than the current solution, but near the light source it's much noisier. We have to restrict the sample region on the area light to the part that lits the ray then, I haven't tried yet to see if it would be less noisy.*

**Point Light**
- [x] the complete ray segment should be valid.

**Spot Light**
- [x] intersect the ray with the spot light cone
- [x] support non-zero radius

Pull Request: https://projects.blender.org/blender/blender/pulls/119438
2024-03-25 13:02:02 +01:00
Jesse Yurkovich
e9eb2d35f8 USD: Add new test files for curves and point instancing 2024-03-24 21:49:55 -07:00
Lukas Stockner
1f44be97e6 Fix #56355: Cycles: Wrong differentials for panoramic camera
The code to compute differentials mixed up the camera-space locations
of the raster coordinate and the camera itself, which caused the dP
differential to be set even when the ray origin is always the same.

This commit fixes that, reorganizes the code so that the Px/Py are
no longer used for both values to avoid future confusion, and skips
some unnecessary calculations stereo rendering isn't being used.
2024-03-24 17:52:22 +01:00
Omar Emara
d5cf430a54 Compositor: Update tests for Hue Correct node 2024-03-21 16:41:30 +02:00
Campbell Barton
6a937d646b Cleanup: remove unused variables 2024-03-21 10:11:54 +11:00
Campbell Barton
9b4683fe0a Tests: update scripts to include SPDX headers 2024-03-20 12:28:33 +11:00
Habib Gahbiche
f9cb2eb988 Cleanup: Tests: update message to refer to git instead of svn
Pull Request: https://projects.blender.org/blender/blender/pulls/119577
2024-03-17 09:47:40 +01:00
Weizhen Huang
b280958372 Tests: update test image due to changes in Cycles NEE 2024-03-15 18:42:30 +01:00
Hans Goudey
a869bae1dc Merge branch 'blender-v4.1-release' 2024-03-15 11:50:04 -04:00
Hans Goudey
1111903416 Fix #119446: Incorrect auto smooth versioning for subsurf modifier
Previously I misunderstood the subsurf modifier's handling of custom
normals. The "use custom normals" check in 4.0 checked if there were
custom normals and whether the auto smooth flag was checked. I wrongly
changed that to check the mesh normals domain instead of whether there
was custom normals. In 4.1, auto smooth isn't required to use custom
normals, but that should be the only change here.

In this PR, that change is done for CPU and GPU subdivision, and for
the versioning which adds a modifier. The versioning now only puts the
new modifier before the subsurf modifier if it would have used the
custom normals interpolation in 4.0.

The last change causes two test failures which I also misunderstood
before. The previous results were arguably incorrect, because the
Cycles experimental adaptive subdivision ignored the auto smooth
angle, which was 5 degrees. It should have been 180 degrees.
I will modify those test files to remove auto smooth from the meshes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119485
2024-03-15 11:32:50 -04:00
Ray Molenkamp
40411b609f tests: update hashes to latest
should fix the failing bots
2024-03-11 22:11:08 -06:00
Brecht Van Lommel
daf3512a51 Merge branch 'blender-v4.1-release' 2024-03-07 20:16:51 +01:00
Brecht Van Lommel
e0c6db81ea Tests: Blacklist microfacet hair test on GPU, due to different curve shape 2024-03-07 19:37:38 +01:00
Campbell Barton
a975c7096a Cleanup: line length in CMake files 2024-03-07 13:26:55 +11:00
Bastien Montagne
8178bffd64 Merge branch 'blender-v4.1-release' 2024-03-06 11:16:00 +01:00