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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
* 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
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
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
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
* 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
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
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
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
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
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.
* 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
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.
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
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
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