Commit graph

41 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
Sebastian
144e9f6efb Refactor: Cycles: Moving IOR inversion inside the OSL closures
In Cycles we previously assumed that the IOR inversion, when hitting a
surface from the backside, for dielectric closures
(e.g., generalized_schlick, microfacet, refract, etc.) is done by the
user in the OSL code. While experimenting with the OSL code generated
by MaterialX and by looking at the example OSL shaders of the OSL
testrender it shows that OSL assumes that this inversion is done
implicitly, inside the closures. This change matches Cycles IOR
inversion behavior with the one expected by MaterialX and OSL
testrender.

Pull Request: https://projects.blender.org/blender/blender/pulls/162634
2026-09-09 09:12:30 +02:00
Weizhen Huang
0fdaf6be0e Cycles: Support anisotropic glass
The functionality is already there, just need to set it up

Implemented for Principled BSDF and Glass BSDF.

Pull Request: https://projects.blender.org/blender/blender/pulls/163343
2026-09-04 10:02:05 +02:00
Christoph Neuhauser
b40da1310b GPU: Add command line option for skipping GPU backend support checks
A new command line option `--debug-gpu-backend-no-fallback` is added
that skips the GPU backend support checks. This is primarily useful for
the GPU tests that should not fall back to another backend. This has the
useful side effect of skipping `vk_instance_create_for_platform_checks`,
which would otherwise create its own Vulkan instance. `vkCreateInstance`
can be an expensive function call depending on the used GPU driver (see
https://projects.blender.org/infrastructure/meta/issues/231).

Pull Request: https://projects.blender.org/blender/blender/pulls/163203
2026-08-28 12:35:23 +02:00
Weizhen Huang
f15daf81bf Cycles: Add dispersion to Principled BSDF
Dispersion is defined by two parameters:
Abbe Number and Dispersion Scale.

This corresponds to OpenPBR v1.1.1

Pull Request: https://projects.blender.org/blender/blender/pulls/162041

Note: dispersion is temporarily disabled when using MNEE (shadow caustics) on oneAPI, due to a compiler bug. Waiting for a fix from the oneAPI side.

![prism.png](/attachments/219c3966-b39d-4846-991b-976f84f83081)
Co-authored-by: Sebastian Herholz <sebastian.herholz@gmail.com>
2026-08-18 11:03:49 +02:00
Christoph Neuhauser
9dfdae1c36 Fix #162523: GPU: Add mipmap workaround for Intel Arc Windows OpenGL
The compute-shader based function `update_mipmaps` can generate broken
mipmaps for Intel Arc Windows OpenGL. A workaround for falling back to
`generate_mipmap` is added to mitigate the issue. Furthermore, a render
test is added that catches the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/162524
2026-08-13 16:03:06 +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
Mark van de Ruit
36b9b24ada GPU: Pass gpu_backend to get_gpu_device_vendor in render tests
As the vulkan backend is now default, `get_gpu_device_vendor()` returns
the selected GPU for Vulkan. In the rare case that OpenGL uses a
different GPU, this causes render tests to use incorrect tolerances and
possibly fail. The PR adds the GPU backend argument to
`get_gpu_device_vendor()` to avoid this\*.

> \* this = confusing me

Pull Request: https://projects.blender.org/blender/blender/pulls/161255
2026-07-09 14:36:38 +02:00
Sergey Sharybin
84515ec017 Fix #147659: Shadow rays for hair don't support colored transparency
Cycles used a single float for the baked transparency.
Change it to RGBE, so that it is colored, and does not increase the
state size.

Pull Request: https://projects.blender.org/blender/blender/pulls/160680
2026-07-06 16:24:00 +02:00
Brecht Van Lommel
516ab47004 Tests: Remove some unnecessary OSL camera test files
Disable for Storm, and removed unused EEVEE reference renders.

Pull Request: https://projects.blender.org/blender/blender/pulls/160318
2026-06-24 14:31:29 +02:00
Brecht Van Lommel
8696c6d226 Tests: Share reference renders between Storm Hydra and USD
Use the mechanism where there is one reference directory, and an override
directory for the cases that are known to be different.

The override is kept only where the committed USD reference and Hydra
reference differ beyond the test threshold; otherwise the Hydra render
is redundant and shares the USD reference. This helps work towards
making them match, and reduces the repository checkout size.

Pull Request: https://projects.blender.org/blender/blender/pulls/160433
2026-06-23 12:33:03 +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
Miguel Pozo
3eee99eb92 Tests: Add missing render tests
Part of #148449.
Add untested features, mostly driven by recent regressions.

- camera_negative_scale
- camera_negative_scale_ortho
- motion_vectors
- holdout (updated to test multiple methods, transparency, and
  reflections)
- material_output_selection

Pull Request: https://projects.blender.org/blender/blender/pulls/154032
2026-05-29 15:07:58 +02:00
Weizhen Huang
6e2b342c9f Render: Add thin wall mode in Principled BSDF
- Thin glass:
An infinitesimally thin sheet of dielectric, approximated by a reflected
lobe and a trasmitted lobe, the respective weights of both lobes are
analytically computed by summing up infinite geometric series that
account for internal reflections.

- Thin subsurface:
An infinitesimally thin sheet of dense scattering material, approximated
by a diffuse lobe and a translucent lobe, the respective weights of both
lobes are given by subsurface anisotropy, with specifies the relative
amount of backward and forward scattering.

Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/157469
2026-05-22 12:53:43 +02: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
f7bca00032 Fix #154128: Cycles normal map wrong renders after corner normal changes
After refactoring to deduplicate code, the normal for the tangent frame was
no longer properly transform to object space. Revert code to how it was
before and add a more explicit function name and comment.

Pull Request: https://projects.blender.org/blender/blender/pulls/154102
2026-02-09 23:20:15 +01:00
Christoph Neuhauser
8560b1ee6a Tests: Add environment variable BLENDER_TEST_IGNORE_VENDOR_BLOCKLIST
This commit adds the environment variable
`BLENDER_TEST_IGNORE_VENDOR_BLOCKLIST` to the GTest and Python tests.
In contrast to `BLENDER_TEST_IGNORE_BLOCKLIST`, this only ignores the
blocklists for tests that are blocked for individual hardware vendors.
When a test fails in Blender due to driver issues, the test is blocked
for the hardware vendor until a fixed driver is available for the CI
workers. This means that hardware vendors need to manually remove the
blocklists when they check the state of test failures.
The new environment variable gives an easy option to also run these
tests in case where seeing these failures (but not general failures,
e.g., due to issues in Blender) is preferrable.

Pull Request: https://projects.blender.org/blender/blender/pulls/153549
2026-01-30 14:25:38 +01:00
Christoph Neuhauser
a8502c7fb3 Fix #148865: Tests: Add Vulkan backend tests for Storm and UI
This PR adds separate Vulkan backend tests for Storm Hydra/USD and UI.
The new tests are called:
- storm_hydra_[backend]_*
- storm_usd_[backend]_*
- ui_[backend]_*

The Vulkan tests are not yet enabled by default due to open issues.
For enabling them, the CMake options WITH_STORM_TESTS_VULKAN and
WITH_UI_TESTS_VULKAN can be turned on.

Pull Request: https://projects.blender.org/blender/blender/pulls/149142
2026-01-27 15:46:19 +01:00
Clément Foucault
4eb82aa00d Fix: Storm: Test failing on AMD GPU
There seems to be the same issue as with a lot
of other transparent test. Blocklist this test.

Pull Request: https://projects.blender.org/blender/blender/pulls/150906
2025-12-01 17:35:47 +01:00
Brecht Van Lommel
ca18fdc7e5 Fix: Black noise texture results with MaterialX export
Clamp octaves to be at least 1 to avoid having no noise at all, and clamp
the maximum to avoid precision issues and NaNs on some GPUs.

Blocklist white noise 256 samples tests entirely for Storm, as we don't
support multiple samples and can't test converting to grey. Increase the
grid size in the 1 sample white noise test to make it more clear.

Pull Request: https://projects.blender.org/blender/blender/pulls/148525
2025-10-27 13:11:04 +01:00
Christoph Neuhauser
94e2fe320d Tests: Pass rasterization dependent Storm tests on Intel Linux
This PR slightly raises the accepted noise level for the Storm tests
"autosmooth custom normals" (mesh) and "sss hair" (sss). They failed
due to what likely is acceptable differences in rasterization.

Pull Request: https://projects.blender.org/blender/blender/pulls/148506
2025-10-22 11:04:46 +02:00
Brecht Van Lommel
a1fde8bed8 Tests: Blocklist failing Storm tests on AMD and Intel
Pull Request: https://projects.blender.org/blender/blender/pulls/148148
2025-10-16 18:03:18 +02:00
Brecht Van Lommel
dbfab80943 Tests: Move GPU vendor query function to module, remove dead code for EEVEE
The implementation of this was broken and not actually used for the EEVEE
tests, as there is currently no separate reference directory for AMD.

Move it to the render report module so it can be reused by different tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/148148
2025-10-16 18:03:17 +02:00
Amogh Shivaram
2bd06093c7 Cycles: Thin film iridescence for metals
Applies thin film iridescence to metals in Metallic BSDF and Principled BSDF.

To get the complex IOR values for each spectral band from F82 Tint colors,
the code uses the parametrization from "Artist Friendly Metallic Fresnel",
where the g parameter is set to F82. This IOR is used to find the phase shift,
but reflectance is still calculated with the F82 Tint formula after adjusting
F0 for the film's IOR.

Co-authored-by: Lukas Stockner <lukas@lukasstockner.de>
Co-authored-by: Weizhen Huang <weizhen@blender.org>
Co-authored-by: RobertMoerland <rmoerlandrj@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/141131
2025-09-29 02:58:20 +02:00
Weizhen Huang
3dc73a3fda Tests: update GPU volume tests
New files are added since 5646d9a5ca

Pull Request: https://projects.blender.org/blender/blender/pulls/144622
2025-08-15 18:15:34 +02:00
Clément Foucault
dde18802a5 GPU: Remove WITH_GPU_RENDER_TESTS_SILENT option
This was introduced during EEVEE-next developement
cycle to not make the buildbot fail because of EEVEE
render tests.

These have stabilized now and we can remove this option.

Pull Request: https://projects.blender.org/blender/blender/pulls/137545
2025-04-15 17:56:16 +02:00
Alaska
7e7594c7ff Tests: Add Cycles test for transparent spatial splitting artifacts
With the HIPRT backend for Cycles, rays can end up hitting the same
triangle multiple times due to a issue in the spatial splitting
algorithm.

Most of the time this issue isn't visible, but it is quite obvious in
semi-transparent shadows of meshes.

So this commit adds a file that contains a object made up of many
semi-transparent rectangular prisms casting a shadow onto the a plane.

Ref: blender/blender#117527
Ref: blender/blender-test-data!76
2025-03-18 02:01:41 +01:00
Alaska
01d80cee28 Tests: Add render tests for outputs of the light path node
This commit adds tests for the outputs of the light path node.

This include many typical tests (E.g. Changing the colour of a material
based on if it's a camera ray or not) along with some "unusual" tests.

Examples include:
- Testing many of the light path node outputs on lights.
  - This includes "analytical" lights and mesh lights, which can behave
    differently depending on if Next Event Estimation or forward path
    tracing occurs.
- Adding extra objects using ray portal BSDFs and transparent BSDFs
  just to double check they don't introduce their own issues.

Ref: blender/blender-test-data!55
2025-02-25 04:34:19 +01:00
Brecht Van Lommel
d8a02dc435 Tests: Update Storm reference renders for USD 25.02 and MaterialX 1.39
Pull Request: https://projects.blender.org/blender/blender/pulls/134411
2025-02-11 20:40:33 +01:00
Brecht Van Lommel
4c2fb20e93 Tests: Fix and workaround Metal difference for Storm
* Disable Metal multisampling to match OpenGL.
* Block list all image half/float tests, these can all fail randomly.
* Blocklist tests failing due to issues in OpenUSD Metal implementation.
2025-02-01 13:03:39 +01:00
Alaska
f85ff21ed0 Tests: Add render tests for texture nodes
Enable render tests in the `texture` folder.

Ref #123012
2025-01-19 00:52:22 +01:00
Jesse Yurkovich
1a01275aa9 Hydra: Update tests to allow bots to pass
Contains the following changes:
- Uses new `render_layer` images in test repo
- Excludes known broken tests with Hydra Storm from USD 24.05
  - packed float and packed half images show corruption
  - USD export doesn't support the current light-tree .blend
- Bump the `image_colorspace` and `image_mapping` thresholds to
  account for image filtering differences from OS/drivers

Pull Request: https://projects.blender.org/blender/blender/pulls/132044
2024-12-18 05:22:01 +01:00
Sybren A. Stüvel
b7028617ad Refactor: render tests, change how argparse is used
Some changes to how argparse is used in render tests:

1. Use the common approach of one dash for single-letter options (`-b`)
   and two dashes for longer options (`--blender`). In this commit that
   just means changing single-dashed (`-testdir`) to double-dashed
   (`--testdir`).

2. Remove unnecessary `nargs` arguments. The code was telling `argparse`
   to put CLI arguments into a list of one item, and then had code to
   turn that one-item list into the item itself. I've just removed the
   `nargs` argument altogether, as that just produces the desired
   value without requiring more code.

   I've also removed `nargs="+"` from the handling of the `--blender`
   parameter, as that allowed for multiple occurrences of `--blender
   {path}` but was silently ignoring all of those except the first.

   To ensure that required arguments are present, the code now uses
   `required=True` instead of `nargs`.

3. Add a `description` parameter so that `--help` shows what the
   test script actually does. Also it helps people (like me) who want
   to figure out which blend file is actually being opened by the
   test, without making the test itself more verbose.

No functional changes, except that you now cannot add multiple
`--blender` arguments any more (the CLI invocation will fail). This wasn't
used anywhere I could find, though.

Pull Request: https://projects.blender.org/blender/blender/pulls/131666
2024-12-10 14:52:34 +01:00
Campbell Barton
2119d271e0 Cleanup: remove "-noaudio" argument in background mode
This is no longer needed as background mode implies -noaudio.
2024-02-14 00:13:38 +11:00
Jeroen Bakker
324ef0cbf4 RenderTest: GPU Render Tests Pass Silently
Add silently fail option to GPU based render tests. This is a pre-requisite to enable
render tests on the buildbot. By default these render tests will pass silently.

* Test will pass when using the `--pass-silently` arguments.
* Only crashes will be reported as failed tests.
* To find out failing test, review the test reports.

`WITH_GPU_RENDER_TESTS_SILENT` compile option can be used to let tests pass (default)
or fail (default for developers).

Although some tests fail, they still passed. In the generated render report,
the silently passed failures are correctly reported to be failures.

Pull Request: https://projects.blender.org/blender/blender/pulls/117629
2024-01-29 15:39:14 +01:00
Sergey Sharybin
f11292104d Render Tests: Separate difference of Color and Alpha
This change fixes confusion situation when the render output
is an RGBA image: the difference in color was not visible in
the report because alpha channel was all zeros. This is due
to idiff performing per-channel difference.

The solution to this problem is to have separate images for
color and alpha difference, which makes it clear where the
difference actually is coming from.
2024-01-25 10:04:16 +01:00
Campbell Barton
5dd91346e1 Cleanup: remove unused imports 2024-01-08 11:40:53 +11:00
Brecht Van Lommel
dccbc27eab Tests: add WIITH_TESTS_BATCHED option to execute Blender once per test
Some tests like cycles, sequencer and compositor batch together multiple
tests in a single Blender invocation. This makes them run faster, but
makes debugging harder. This is an option to disable that batching.

Pull Request: https://projects.blender.org/blender/blender/pulls/114603
2023-11-08 18:41:33 +01:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Brecht Van Lommel
fa34d893f1 Fix wrong render test comparison for Storm USD and Hydra 2023-08-07 15:13:03 +02:00
Brecht Van Lommel
647f2053a9 Tests: add automated regressions tests for Hydra Storm
These are meant to test Hydra integration. Currently they are only enabled
for WITH_OPENGL_RENDER_TESTS=ON due to similar reasons as Eevee and
Workbench, which is that they require a GPU and results can be platform
dependent due to hardware and driver differences.

There are separate tests for USD and Hydra export paths. The goal is to
make these identical, but they aren't yet. So for that reason they have
separate reference renders, and there is a HTML page to compare them.

Ref #110765
2023-08-04 17:01:09 +02:00