Fix T54278: volume artifacts with small density and color after recent changes.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sat, 10 Mar 2018 04:03:03 +0000 (05:03 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sat, 10 Mar 2018 05:27:19 +0000 (06:27 +0100)
intern/cycles/kernel/geom/geom_volume.h

index 286d898..a4e4738 100644 (file)
@@ -68,7 +68,7 @@ ccl_device float3 volume_attribute_float3(KernelGlobals *kg, const ShaderData *s
        if(dx) *dx = make_float3(0.0f, 0.0f, 0.0f);
        if(dy) *dy = make_float3(0.0f, 0.0f, 0.0f);
 
-       if(r.w != 0.0f && r.w != 1.0f) {
+       if(r.w > 1e-8f && r.w != 1.0f) {
                /* For RGBA colors, unpremultiply after interpolation. */
                return float4_to_float3(r) / r.w;
        }