Fix T100205: Cycles wrong volume shading with two materials in object

Assume that all faces using the smae material form a closed mesh, so that
joining meshes gives the same result as separate meshes.

It does mean that using different materials on different sides of one
closed mesh do not work, but the meaning of that is poorly defined anyway
if there is a volume interior.
This commit is contained in:
Brecht Van Lommel 2022-08-04 18:57:05 +02:00
parent 11b4d0a3c3
commit 91d365f6df
Notes: blender-bot 2023-04-19 22:54:54 +02:00
Referenced by issue #103823, Regression: wrong rendering when the same object has faces with different volume materials
Referenced by issue #100205, Volumetrics bug
1 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ ccl_device void volume_stack_enter_exit(KernelGlobals kg,
break;
}
if (entry.object == sd->object) {
if (entry.object == sd->object && entry.shader == sd->shader) {
/* Shift back next stack entries. */
do {
entry = stack_read(i + 1);
@ -61,7 +61,7 @@ ccl_device void volume_stack_enter_exit(KernelGlobals kg,
}
/* Already in the stack? then we have nothing to do. */
if (entry.object == sd->object) {
if (entry.object == sd->object && entry.shader == sd->shader) {
return;
}
}