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@pandora.be>2013-04-05 20:43:53 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-04-05 20:43:53 +0400
commit3863e72c735af5a0fbf07cfe6d5f15dbc46d9850 (patch)
treeb459279e0fad7231c1c166ba5a888494d4d77838 /intern/cycles/kernel/shaders/node_color.h
parenteb11b590a8d5c2152b0f811fc2240aba2e76f6de (diff)
Fix #34679: cycles image texture alpha fringes. New rule is now that color output
will not give straight RGB values if the alpha output is used, so that mixing with a transparent BSDF gives the correct result.
Diffstat (limited to 'intern/cycles/kernel/shaders/node_color.h')
-rw-r--r--intern/cycles/kernel/shaders/node_color.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/intern/cycles/kernel/shaders/node_color.h b/intern/cycles/kernel/shaders/node_color.h
index 80786e4e369..c6b5d740f6a 100644
--- a/intern/cycles/kernel/shaders/node_color.h
+++ b/intern/cycles/kernel/shaders/node_color.h
@@ -48,6 +48,14 @@ color color_scene_linear_to_srgb(color c)
color_scene_linear_to_srgb(c[2]));
}
+color color_unpremultiply(color c, float alpha)
+{
+ if(alpha != 1.0 && alpha != 0.0)
+ return c/alpha;
+
+ return c;
+}
+
/* Color Operations */
color rgb_to_hsv(color rgb)