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:
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
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue