Found those missing casts while looking into a crash report made in
the Blender Chat. Was unable to reproduce the crash, but the casts
should totally be there to avoid integer overflow.
Ensure the correct total/diffuse/transmission depth is set when evaluating
shaders for MNEE, consistent with regular light shader evaluation.
Differential Revision: https://developer.blender.org/D14902
Made tangent frame consistent across the surface regardless of the sample,
which was not the case with the previous algorithm. Previously, a tangent
frame would stay consistent for the same sample throughout the walk, but not
from sample to sample for the same triangle. This actually resulted in code
simplification.
Also includes additional fixes:
* Fixed an important bug that manifested itself with multiple lights in the
scene, where caustics had abnormally low amplitude: The final light pdf did
not include the light distribution pdf.
* Removed unnecessary orthonormal basis generation function, using cycles'
native one instead.
* Increased solver max iteration back to 64: It turns out we sometimes need
these extra iterations in cases where projection back to the surface takes
many steps. The effective solver iteration count, the most expensive part,
is actually much less than the raw iteration count.
Differential Revision: https://developer.blender.org/D14931
This completes support for tiled texture packing on the Blender / Cycles
side of things.
Most of these changes fall into one of three categories:
- Updating Image handling code to pack/unpack tiled and multi-view images
- Updating Cycles to handle tiled textures through BlenderImageLoader
- Updating OSL to properly handle textures with multiple slots
Differential Revision: https://developer.blender.org/D14395
Assume geometry is always potentially animated, since we can't use our heuristic
to detect if the object is potentially animated by looking at modifiers on the
object.
The main original reason for this check was to avoid evaluating subdivision
surfaces for many static objects, which is not happening here anyway.
Partially reverts rB46ae0831134 now that we have a new version of
OSL/OIIO that supports <UVTILE> directly.
Differential Revision: https://developer.blender.org/D14851
It was wrongly writing passes twice, for both the surface entry and exit points.
We can skip code for filtering closures, emission and holdout also, as these do
nothing with only a subsurface diffuse closure present.
OptiX 7.4 adds support for splitting the costly creation of an OptiX
module into smaller tasks that can be executed in parallel on a
thread pool.
This is only really relevant for the "shader_raytrace" kernel variant
as the main one is small and compiles fast either way. It sheds of
a few seconds there (total gain is not massive currently, since it is
difficult for the compiler to split up the huge shading entry point
that is the primary one taking up time, but it is still measurable).
Differential Revision: https://developer.blender.org/D14845
evice_update_preprocess is supposed to detect modified attributes and flag the
device_vector for a copy through device_update_flags. However, since object
attributes are only created in device_update_attributes afterwards, they can't
be included in that check.
Change the function that actually updates the device_vector to tag it as
modified as soon as its content gets updated.
Differential Revision: https://developer.blender.org/D14815
A shader node setup accidentally used the bump normal as emission. Bump
mapping nodes are excluded from light shader evaluation to reduce kernel size
and register pressure, but in that case should write zero instead of leaving
memory uninitialized.
Thanks to Lukas for helping identify the cause.
Inspired by D12936 and D12929, this patch adds general purpose
"Combine Color" and "Separate Color" nodes to Geometry, Compositor,
Shader and Texture nodes.
- Within Geometry Nodes, it replaces the existing "Combine RGB" and
"Separate RGB" nodes.
- Within Compositor Nodes, it replaces the existing
"Combine RGBA/HSVA/YCbCrA/YUVA" and "Separate RGBA/HSVA/YCbCrA/YUVA"
nodes.
- Within Texture Nodes, it replaces the existing "Combine RGBA" and
"Separate RGBA" nodes.
- Within Shader Nodes, it replaces the existing "Combine RGB/HSV" and
"Separate RGB/HSV" nodes.
Python addons have not been updated to the new nodes yet.
**New shader code**
In node_color.h, color.h and gpu_shader_material_color_util.glsl,
missing methods hsl_to_rgb and rgb_to_hsl are added by directly
converting existing C code. They always produce the same result.
**Old code**
As requested by T96219, old nodes still exist but are not displayed in
the add menu. This means Python scripts can still create them as usual.
Otherwise, versioning replaces the old nodes with the new nodes when
opening .blend files.
Differential Revision: https://developer.blender.org/D14034
The Multiscatter GGX code was missing the same-side checks for incoming and
outgoing directions w.r.t. to shading and geometry normal.
Should not be needed for the Glass variant since it intentionally has both
reflection and transmission.