[Bf-blender-cvs] [acd619d7c92] master: Cycles: change smoke color grid to not include density multiplied in.

Brecht Van Lommel noreply at git.blender.org
Fri Feb 23 19:02:22 CET 2018


Commit: acd619d7c9250282d68b917d6cae5c08301bb989
Author: Brecht Van Lommel
Date:   Sun Feb 18 03:16:29 2018 +0100
Branches: master
https://developer.blender.org/rBacd619d7c9250282d68b917d6cae5c08301bb989

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.

===================================================================

M	intern/cycles/kernel/geom/geom_volume.h

===================================================================

diff --git a/intern/cycles/kernel/geom/geom_volume.h b/intern/cycles/kernel/geom/geom_volume.h
index 6be448c4fa4..286d898992e 100644
--- a/intern/cycles/kernel/geom/geom_volume.h
+++ b/intern/cycles/kernel/geom/geom_volume.h
@@ -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



More information about the Bf-blender-cvs mailing list