Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-18 05:16:29 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-23 20:57:58 +0300
commitacd619d7c9250282d68b917d6cae5c08301bb989 (patch)
treeabca6a43f8ebcbf38b287fd82b56cfab312410fc /intern/cycles/kernel
parenta963c7d48dade70474ec3b40bea5e99ebdbbc5d4 (diff)
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.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/geom/geom_volume.h8
1 files changed, 7 insertions, 1 deletions
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