I've never noticed this before so I hope it's not some setting I've overlooked, but when rendering an object with an OSL material the flipped/backfacing faces will render black in the diffuse, even if you assign a colour to them specifically with backfacing() or when overriding the normal with (0.5, 0.5, 1) in the shader.
It won't render the default colour, it will always just render black. In both 3.2 & 3.3.
A VRay mat renders fine, it's not a backface culling then.
Have a look at the following shader. If you assign it to two planes, one rotated 180 degrees, one will show up green and the other black. Ideally the other one would render red.
Is there a fix/workaround for this? Thanks!
It won't render the default colour, it will always just render black. In both 3.2 & 3.3.
A VRay mat renders fine, it's not a backface culling then.
Have a look at the following shader. If you assign it to two planes, one rotated 180 degrees, one will show up green and the other black. Ideally the other one would render red.
Code:
surface normTest ( ) { color c_diff = color(0.5); if (backfacing()) { c_diff = color(1,0,0); } else { c_diff = color(0,1,0); } Ci = diffuse(N) * c_diff; }
Comment