Cycles: change smoke color grid to not include density multiplied in.

This breaks backwards compatibility some, making smoke colors brighters
than before. But it is also more correct this way.
This commit is contained in:
Brecht Van Lommel 2018-02-18 03:16:29 +01:00
parent a963c7d48d
commit acd619d7c9
Notes: blender-bot 2023-02-14 06:07:48 +01:00
Referenced by issue #54278, Cycles volume artifacts after pre-multiplication commit
1 changed files with 7 additions and 1 deletions

View File

@ -68,7 +68,13 @@ 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);
return float4_to_float3(r);
if(r.w != 0.0f && r.w != 1.0f) {
/* For RGBA colors, unpremultiply after interpolation. */
return float4_to_float3(r) / r.w;
}
else {
return float4_to_float3(r);
}
}
#endif