Commit graph

132 commits

Author SHA1 Message Date
Sergey Sharybin
819d52f3d2 GSplat: Initial rendering support for Cycles
Based on the "Stochastic ray tracing of transparent 3D Gaussians" paper
by Xin Sun et. al. The basic idea: perform stochastic intersection with
the Gaussian splat based on its transparency.

Gaussian splats are implemented as a dedicated primitive type, but it
shares the same layout for position and radius as points, so a lot of
existing functions (positions, attributes, etc) work for both points
and splats.

For the Embree and hardware intersection it is implemented as a custom
primitive type.

The choice of using bounding spheres mainly comes from a balance between
performance and memory usage. More ideal would be to use OBB, but it is
not supported for custom primitive types in Embree and GPU HW-RT on all
backends.

There is a known limitation that comes from the fact that the datasets
are trained in sRGB space and Cycles work in Linear space: areas with
low opacity and high radiance render noticeably differently from the
ground-truth implementation.

Ref #159470

Pull Request: https://projects.blender.org/blender/blender/pulls/163103
2026-09-16 16:52:10 +02:00
Jonas Holzman
e3b46bb971 Cycles: Remove macOS < 13 MNEE disabling checks
In D16235[^1], Cycles MNEE was only enabled on macOS 13 and above due to
an inefficiency in the calculation of spill requirements (quoting from
the patch), following the minimum macOS deployment target bump to 13.0
in !163627, remove the now unneeded checks this patch introduced, both
on the Cycles feature side, UI side and Cycles test blocklist.

Additionally, as the `__KERNEL_METAL_MACOS__` global define introduced
by this patch didn't have any other additional users, it was also
removed.

[^1]: https://archive.blender.org/developer/D16235

Pull Request: https://projects.blender.org/blender/blender/pulls/163665
2026-09-08 15:19:11 +02:00
Miguel Pozo
2e99eccf5e Tests: Add many lights render test
A scene with 512 lights inside a box, to test that we handle scenes
with many lights correctly.

Disabled in Cycles due to high noise variance between platforms even at
high samples.

Pull Request: https://projects.blender.org/blender/blender/pulls/161009
2026-07-10 19:37:48 +02:00
Brecht Van Lommel
13bf4f3264 Fix: Cycles OSL test failures with default Vulkan Backend
Use OpenGL for these tests for now, until we fix this in LLVM or OSL.
Initializing Vulkan is somehow affecting memory allocating so that the
LLVM JIT is not placing code and data sections within 4GB of each other,
which is a requirement on Windows.

Ref #152968

Pull Request: https://projects.blender.org/blender/blender/pulls/160984
2026-07-02 20:37:57 +02:00
Brecht Van Lommel
0e06daffc8 Tests: Cycles: Blocklist normal map light leak test for HIP-RT
This is already on the verge of failure, and small changes are pushing this
over the threshold. Blocklist for now to unblock those PRs that do not
actually make this worse.

Ref #159824, #159635
2026-06-24 22:24:49 +02:00
Brecht Van Lommel
1319a955eb Fix #160256: Cycles OptiX crash with OSL camera and shader raytrace
This particular combination was not computing the stack size correctly,
since shader raytrace was moved to a separate OptiX module. It needs to
be set manually now that it's not part of the same module.

Regression from c51fcf73a7.

Pull Request: https://projects.blender.org/blender/blender/pulls/160318
2026-06-24 14:31:29 +02:00
Brecht Van Lommel
61ca1b5856 Fix #160089: Cycles: Disable MNEE on HIP without hardware ray-tracing
Unfortunately it appears that moving MNEE to another kernel did not
fundamentally fix the apparent compiler bug that breaks this. Another
refactor in 0baa98866c made the bug surface again.

It appears to work fine with HIP-RT, so we leave that case enabled.
HIP-RT is also enabled by default, so it's not as bad.

Pull Request: https://projects.blender.org/blender/blender/pulls/160110
2026-06-23 12:33:04 +02:00
Ray Molenkamp
72f8c89b77 Core: add --console-crash-handler flag
Initially noted by devops as a problem: UI tests when crashing
spawn our crash dialog, that will just sit there for 1200 seconds
until the CI environment decides the test has failed and kills the
process, clicking away the dialog also works, but neither option is
ideal here.

The crash handler knows when we are in background mode, (`-B`) and
suppresses this dialog so this is why it has not been an issue for the
normal tests. However when we do crash we get an unhelpful message
saying `Writing: blender.crash.txt` which is not collected by buildbot
so unless a developer can get a devops person to go retrieve this file
its contents will be left to ones imagination.

This PR adds a `--console-crash-handler` argument that does two things:

1 - Suppress the crash dialog even when we are not in background mode
2 - Rather than writing the crash data to blender.crash.txt write this
information to stderr so it shows up in the CI logs.

It also updates all invocations of blender I could find in our test
scripts to pass this new flag. The benchmark scripts have not been
updated as they regularly run against older blender versions that may
not support the new flag.

Pull Request: https://projects.blender.org/blender/blender/pulls/159983
2026-06-15 20:23:29 +02:00
Brecht Van Lommel
5c06bf4361 Fix #159340: Cycles hair not following deforming mesh in viewport
Introduced in e9c36249f7, missing update tags that caused the BVH to
not be rebuilt. Remove dedicated booleans on Geometry so they can not be
out of sync with the attribute modified boolean.

Pull Request: https://projects.blender.org/blender/blender/pulls/159540
2026-06-04 23:42:16 +02:00
Brecht Van Lommel
5fc85d1cb7 Refactor: Cycles: Move MNEE walk into separate kernel
The new intersect_mnee kernel runs before shade_surface, and
shade_surface_mnee is eliminated. That large kernel was causing problems
for some GPU compilers.

MNEE state is packed into a shadow path state to avoid significantly
increasing the path state size. This shadow state is then either turned
into an actual shadow ray state or discarded in shade_surface.

MNEE was re-enabled on HIP RDNA2 as it works again now. Texture cache
misses now also work correctly with MNEE.

This adds some extra code to the regular shade_surface kernel even when
MNEE is not used, to use the MNEE sampled point instead of sampling a
light. But there seems to be no significant performance impact.

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/158698
2026-05-27 20:34:06 +02:00
Brecht Van Lommel
8a99f35a75 Tests: Split cycles bake tests to sidestep OSL OptiX timeouts
Compile time here can be long, run bake tests that require shader
ray-tracing separately so that these heavy kernels are compiled
separate from the others and each category fits within the timeout.

Pull Request: https://projects.blender.org/blender/blender/pulls/158770
2026-05-18 22:29:04 +02:00
Clément Foucault
4bbe6e4dab EEVEE: Add support for lightprobe plane on Blended material
This adds back lightprobe plane support for Blended Material
and Shader to RGB evaluation.

This adds a parallax property on the Lightprobe Planes to tweak
the amount of (non-physical) distortion caused by normals.

Unlike legacy EEVEE (4.1) this implementation does not do any
raytracing even if raytracing is enabled in the render options.
Instead, it uses the same heuristic when raytracing was disabled
in 4.1. However, it now uses the new parallax amount from the
planar lightprobe property.

The heuristic fades out reflections if the normal differs from
the reflection direction or if roughness is not small.

To avoid big regression in compile time, the sampling of the
planar probe is done only once for all the BSDFs and using the
average normal.

Fix #135198

Pull Request: https://projects.blender.org/blender/blender/pulls/158483
2026-05-13 19:50:22 +02:00
Alaska
cba5b6c8c4 Cycles: Disable MNEE on Windows RDNA2
With the update to ROCm 7, Windows RDNA2 experiences artifacts when
using HIP with MNEE.

This commit temporarily disables MNEE on this configuration until it
can be fixed.

Ref #157541

Pull Request: https://projects.blender.org/blender/blender/pulls/158432
2026-05-11 20:45:27 +02:00
Clément Foucault
42a6cd5920 EEVEE: Add ray backface hit behavior option
This is a scene wide option to choose backface hit behavior
for screen tracing. This allows more control of the look
of the Global Illumination.

Backface hits are defined as hitting the camera facing
geometry from behind.

The option is a slider that allows to reuse part of the
front-face radiance as backface indirect lighting
contribution.

Not considering rays hitting backfaces as "missed" ray
most of the light leaking that can happen when using
Screen Space Global Illumination.

The option can be turned off all-together using the checkbox
for compatibility reasons. Turning it off will recover the
same "ray fail" behavior of the previous version.

Note that this patch modifies what is treated as a backface hit.
The previous definition could return true on ray going away
from the viewer, which was incorrect. This fixes small patches
of missing hits next to depth discontinuities. This is why
one test needed to be updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/157803
2026-05-05 12:15:36 +02:00
Brecht Van Lommel
329e8a5cfc Fix #156474, #156473: Cycles wrong mipmap with some types of texture coords
Creating a texture coordinate by combining a UV Map with a white noise
texture did not properly handle that one provides derivatives while the
other does not. It would read from wrong or uninitialized stack memory,
now make sure that is zeroed.

Pull Request: https://projects.blender.org/blender/blender/pulls/156596
2026-04-01 17:56:58 +02:00
Brecht Van Lommel
e9e61bff39 Tests: Add texture cache image tests
Add texture cache variations of image tests. Re-using the existing
mechanism from volume ray marching, but tweaked so they appear on
the same results.html page.

Add new image_mipmap tests that use an image with different colored
mipmap levels, testing ray differentials and mipmaps in different
scenes.

Pull Request: https://projects.blender.org/blender/blender/pulls/154913
2026-03-27 16:07:07 +01:00
Brecht Van Lommel
db9060b4d3 Cycles: Stop using OpenImageIO texture cache for OSL
This will be replaced by the texture cache. Advanced OpenImageIO features
will no longer be available, and texture filtering results will be different.
But performance will be better and there will be consistency with SVM.

OSL specifc image tests were removed as these now match SVM exactly and are
tested by WITH_CYCLES_TEST_OSL.

Pull Request: https://projects.blender.org/blender/blender/pulls/154913
2026-03-27 16:07:05 +01:00
Miguel Pozo
cfc25059e7 Render Tests: Add instancing-types
Made for testing #154963.

Pull Request: https://projects.blender.org/blender/blender/pulls/155956
2026-03-25 15:06:06 +01:00
Brecht Van Lommel
7ef18aca68 Fix #155861: Crash rendering CMYK JPEG textures in Cycles
The OpenImageIO version we use has broken CMYK to RGB conversion in
JPEG, this is a temporary workaround until we upgrade to a newer
version. Directly read the CMYK image with libjpeg.

Note that when we upgrade, we can remove the CMYK conversion code
entirely as OpenImageIO supports this natively nowadays.

Pull Request: https://projects.blender.org/blender/blender/pulls/155946
2026-03-23 10:33:24 +01:00
Mark van de Ruit
24d6138e16 EEVEE: Add ShaderToRGB+Subsurface test
Adds a simple test to catch some behaviors I fixed in #154819, buggy
interactions between Diffuse/Glossy/ShaderToRGB/Subsurface shaders.

Pull Request: https://projects.blender.org/blender/blender/pulls/154872
2026-02-25 16:29:08 +01:00
Brecht Van Lommel
110de4f488 Cycles: Half float denormals and optimizations
* Switch to more accurate half and float conversion supporting denormals
  to match native instructions. This makes CPU and GPU match more
  closely in some tests and avoids clipping some low values.
* Inf and NaN are not supported still, as we already filter these out
  and there is no reason to have the overhead.
* Change avx2 kernel to require f16c. For all physical CPUs avx2 implies
  f16c, and it's only for emulation and virtual machines that this would
  not be the case. So it's fine to fall back to the sse4.1 kernel then.
* Assume half instructions are available with ARM NEON. There is no
  defined minimum architecture, but Blender assumes the same and ARMv8.2-A
  is relatively old.
* For everything else there are SIMD optimized fallbacks.
* New unit tests were added, coverting both native instructions and
  fallback implementations, and half/half3/half4.

Fix #152763: Half float image low values are clipped

Pull Request: https://projects.blender.org/blender/blender/pulls/154042
2026-02-09 13:01:08 +01:00
Miguel Pozo
f7f6bdac6e Shader Nodes: Raycast node
Initial implementation of the Raycast Node #139339.

Pull Request: https://projects.blender.org/blender/blender/pulls/150085
2026-02-04 02:38:03 +01:00
Clément Foucault
dd12ff0af5 EEVEE: Add support for Transparent BSDF through Shader To RGB
This PR adds to possibility to get the radiance behind an object using
the Shader To RGB workflow.

The result of this operation depends on the type of material.
- Dithered Material with Raytraced Transmission **off** will sample the nearest probe.
- Dithered Material with Raytraced Transmission **on** will show Dithered Materials
  with transmission **off** or fallback to nearest probe.
- Blended Material will show all Dithered Material materials or fallback to nearest probe.

This covers some workflows that were possible before 4.2 (which
were relying on the refraction BSDF).

This removes the `use_combined_lightprobe_eval` optimization which was defaulting
all Dithered Material to be in the same layer when raytracing was off.

We cannot do that anymore since this transparency feature requires clear separation
between the two material types (Raytraced Transmission on/off).
We could eventually reintroduce it by changing the way the submission is done when
there is no shader to rgb in the scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/149723
2025-11-28 17:09:06 +01:00
Weizhen Huang
992ad878fd Cycles: Improve compilation time of tricubic interpolation
by using a loop instead of unrolling all 64 evaluations.
Seems that two nested loops has the best performance.

Compilation time measured on Metal M2 Ultra:
|                              Kernel| Before|  After|
|                                  --|     --|     --|
|             integrator_shade_volume|148.13s|114.71s|
|integrator_shade_volume_ray_marching| 44.30s| 14.27s|
|             integrator_shade_shadow| 87.83s| 58.82s|
|          shader_eval_volume_density| 32.69s|  6.63s|

Also added test file because we were not testing deterministic tricubic
interpolation before

Ref: #150119
2025-11-28 14:43:35 +01:00
Miguel Pozo
d14e71d9b9 EEVEE: Add tests for untested EEVEE-specific features
Part of #148449

This also adds a way to skip certain parts of the EEVEE_render_test
setup by storing (optional) boolean properties in the scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/149471
2025-11-17 18:07:13 +01:00
Sergey Sharybin
5ee406a743 Merge branch 'blender-v5.0-release' 2025-10-15 17:13:54 +02:00
Sergey Sharybin
969214cba8 Tests: Blocklist known failures for Cycles render tests
This change marks hair_linear_close_up.blend is blocked for Metal-RT.
Linear curves parameterization is different, see #146072

Pull Request: https://projects.blender.org/blender/blender/pulls/148119
2025-10-15 17:13:16 +02:00
Jesse Yurkovich
024f396d06 Cleanup: Fix typos in tests subdirectory
Fixes various typos

Co-authored-by: luz paz
Pull Request: https://projects.blender.org/blender/blender/pulls/148090
2025-10-14 22:35:54 +02:00
Brecht Van Lommel
7f94df2926 Tests: Block failing object_dicing test on OptiX OSL
This does not support wireframe yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/147124
2025-10-01 16:23:38 +02:00
Weizhen Huang
2b0a1cae06 Cycles: Add an option to use ray marching for volume rendering
Null Scattering currently has performance and noise issues, and it will
take time to address them. For now add the previous Ray Marching back as
an option.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/146317
2025-09-26 12:14:45 +02:00
Brecht Van Lommel
6a083a5464 Color Management: Add working color space for blend files
* Store scene linear to XYZ conversion matrix in each blend file, along
  with the colorspace name. The matrix is the source of truth. The name
  is currently only used for error logging about unknown color spaces.
* Add Working Space option in color management panel, to change the
  working space for the entire blend file. Changing this will pop up
  a dialog, with a default enabled option to convert all colors in
  the blend file to the new working space. Note this is necessarily only
  an approximation.
* Link and append automatically converts to the color space of the main
  open blend file.
* There is builtin support for Rec.709, Rec.2020 and ACEScg working spaces,
  in addition to the working space of custom OpenColorIO configs.
* Undo of working space for linked datablocks isn't quite correct when going
  to a smaller gamut working space. This can be fixed by reloading the file
  so the linked datablocks are reloaded.

Compatibility with blend files saved with a custom OpenColorIO config
is tricky, as we can not detect this.

* We assume that if the blend file has no information about the scene
  linear color space, it is the default one from the active OCIO config.
  And the same for any blend files linked or appended. This is effectively
  the same behavior as before.
* Now that there is a warning when color spaces are missing, it is more
  likely that a user will notice something is wrong and only save the
  blend file with the correct config active.
* As no automatic working space conversion happens on file load, there is
  an opportunity to correct things by changing the working space with
  "Convert Colors" disabled. This can also be scripted for all blend files
  in a project.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/145476
2025-09-05 19:04:47 +02:00
Weizhen Huang
5646d9a5ca Cycles: Add and update volume test files 2025-08-13 10:28:50 +02:00
Brecht Van Lommel
7978799e6f Cycles: Always render volume as NanoVDB
All GPU backends now support NanoVDB, using our own kernel side code
that is easily portable. This simplifies kernel and device code.

Volume bounds are now built from the NanoVDB grid instead of OpenVDB,
to avoid having to keep around the OpenVDB grid after loading.

While this reduces memory usage, it does have a performance impact,
particularly for the Cubic filter. That will be addressed by
another commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/132908
2025-07-09 21:04:38 +02:00
Brecht Van Lommel
ba5bdbcf28 Merge branch 'blender-v4.5-release' 2025-07-07 19:30:07 +02:00
Alaska
b3cc9ed21b Tests: Add intial tests for the OSL camera
This commit adds 4 tests covering the majority of the new features
added with the OSL camera feature.

Pull Request: https://projects.blender.org/blender/blender/pulls/139426
2025-07-07 19:08:44 +02:00
Alaska
7771c36270 Tests: Add tests for AOV passes on objects with transparent materials
This commit adds a test for the situation in which a AOV pass is used
on a object with a fully or semi-transparent material, either using the
transparent BSDF directly, or mixing it with some other material.

Pull Request: https://projects.blender.org/blender/blender/pulls/141068
2025-07-04 14:29:11 +02:00
Brecht Van Lommel
b920f6f1a7 Shaders: Remove point density texture node
This is replaced by geometry nodes, where volumes can now be generated from
point clouds and meshes with more control, and more efficient rendering as a
sparse volume.

No backwareds compatibility is provided, as this would be complicated, and
probably this feature was not used much in the past few years.

This node was supported in Cycles only, not by EEVEE.

Pull Request: https://projects.blender.org/blender/blender/pulls/140292
2025-06-16 12:06:02 +02:00
Alaska
e71a1bbf70 Tests: Allow OptiX to run tests in the OSL folder
In the render test suite there is an OSL folder that contains tests that
need OSL to function.

Previously due to some missed logic, the OptiX OSL test suite would not run
tests in that folder because part of the test code assumed that if you aren't
testing on a CPU, then your device doesn't support OSL.

This commit fixes this issue.

Along with this change, some logic was changed in preparation for allowing
OptiX OSL camera tests to run without OSL shading enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/139433
2025-06-03 14:46:32 +02:00
Lukas Stockner
be4268ec1c Tests: Cycles: Remove OSL-specific displacement test after fix to match SVM
Since commit 175686f2, the behavior of OSL now matches SVM, so instead of this
separate test this is handled by the regular test and the "does OSL match SVM"
checks.
2025-04-28 14:53:05 +02:00
Lukas Stockner
54b156bf16 Cycles: Add support for automatic bump mapping on OptiX OSL
All the required parts are already there, just needs to be hooked up.
This is essentially just copying what `osl_eval_nodes<SHADER_TYPE_SURFACE>`
does on the CPU.

Fixes #104276.

Pull Request: https://projects.blender.org/blender/blender/pulls/138044
2025-04-28 12:47:31 +02:00
Brecht Van Lommel
df053e290d Fix #137621: Cycles curve info random gives wrong value
Caused by filter width changes in 5ce239cc22.

Pull Request: https://projects.blender.org/blender/blender/pulls/137671
2025-04-17 19:15:05 +02:00
Alaska
21add72f31 Tests: Add Cycles test for RDNA1 Principled BSDF rendering issue
This commit adds a render test for the issue reported in
blender/blender#137420.

Ref: blender/blender-test-data!84
2025-04-15 09:20:09 +02:00
Brecht Van Lommel
de821416c7 Cycles: Adaptive subdivision dicing and splitting improvements
* Share vertices between patches instead of using stitch map
* Switch to OpenSubdiv compatible counter-clockwise indexing
* Simplify patch edge reverse direction logic
* Add more comments to splitting and dicing

Pull Request: https://projects.blender.org/blender/blender/pulls/135681
2025-03-11 20:58:33 +01:00
Brecht Van Lommel
655ccf1d7a Fix #135086: Light ray visibility not taken into account without light tree
Re-enable tests that were temporarily disabled for this.

Caused by #134846, e813e46327
2025-02-25 17:24:04 +01:00
Alaska
88989ed921 Tests: Temporarily block glossy light path tests
Glossy light path tests are unexpectedly failing on build bot.
My current guess is that something changed between when the reference
images were made and when the tests were committed.

While an investigation into what's causing it is going on, these tests
have been temporarily added to the blocklist to avoid unexpected
failures for other developers.
2025-02-25 17:51:48 +13:00
Alaska
74808ac2c3 Tests: Enable OptiX OSL generated volumetric texture coordinate tests
In a recent commit (1), a bug was fixed where the generated texture
coordinates on volumes in Cycles with OptiX OSL was incorrect.

Due to this fix, OptiX OSL now passes render tests in scenes that use
that feature, so this commit enables those tests on that platform.

(1) 0177537c9a

Pull Request: https://projects.blender.org/blender/blender/pulls/134629
2025-02-16 06:02:04 +01:00
Ray Molenkamp
1540817576 For VFX platform 2025 and more.
Boost (removed!)
Cython 3.0.11
Expat 2.6.4
GMP 6.3.0
MaterialX 1.39.2
Nanobind 2.1.0 (new, for OpenVDB)
NumPy 1.26.4
OpenColorIO 2.4.1
OpenEXR 3.3.2
OpenImageIO 3.0.3.1
OpenVDB 12.0.0
OSL 1.14.3-beta
Python 3.11.11
Robinmap 1.3.0
TBB 2021.13.0
TIFF 4.7.0
USD 25.02
libxml2 2.13.5
zlib 1.3.1

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Jonas Holzman <jonas@holzman.fr>
Co-authored-by: Sebastian Parborg <sebastian@blender.org>

Ref #128577

Pull Request: https://projects.blender.org/blender/blender/pulls/134178
2025-02-06 14:57:02 +01:00
Alaska
ce4722a954 Cleanup: Use RenderReport variation in Cycles render tests
In ea7d07098b, the RenderReport base
class was reworked to work better with test variations.

This commit reworks the Cycles render tests file to use the new
variation system for Hardware Ray tracing and OSL tests, avoiding the
custom system put in place in previous commits.

Pull Request: https://projects.blender.org/blender/blender/pulls/133813
2025-02-03 04:16:27 +01:00
Brecht Van Lommel
7f0f8b0e46 Tests: Use descriptive name for tests in reports category 2025-02-01 13:03:39 +01:00
Alaska
ea7d07098b Tests: Disable --cycles-device arguments on non-Cycles tests
This commit reworks the RenderReport base class to avoid adding
`--cycles-device` device arguments to non Cycles tests.

This reduces some warnings that can show up with EEVEE and
Workbench tests that accidentally used these arguments.

Pull Request: https://projects.blender.org/blender/blender/pulls/133724
2025-01-30 04:15:27 +01:00