diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-21 17:05:10 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-21 17:05:10 +0400 |
commit | 86c7bf733124b2959c4586e2e315e6a4ad53f725 (patch) | |
tree | 5eebb046c5ac600e32898f6a2a10273e548b5879 /intern/cycles/render/nodes.cpp | |
parent | 2e3035dd80ff3c69c38195f10c0ab9efdd6ed3ec (diff) |
Fix #35812: cycles image texture node not doing proper alpha handling of PNG
images with open shading language enabled.
Diffstat (limited to 'intern/cycles/render/nodes.cpp')
-rw-r--r-- | intern/cycles/render/nodes.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index 74033d5c2fa..3672b893825 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -237,6 +237,8 @@ void ImageTextureNode::compile(SVMCompiler& compiler) void ImageTextureNode::compile(OSLCompiler& compiler) { + ShaderOutput *alpha_out = output("Alpha"); + tex_mapping.compile(compiler); if(is_float == -1) @@ -250,6 +252,7 @@ void ImageTextureNode::compile(OSLCompiler& compiler) compiler.parameter("projection", projection); compiler.parameter("projection_blend", projection_blend); compiler.parameter("is_float", is_float); + compiler.parameter("use_alpha", !alpha_out->links.empty()); compiler.add(this, "node_image_texture"); } @@ -358,6 +361,8 @@ void EnvironmentTextureNode::compile(SVMCompiler& compiler) void EnvironmentTextureNode::compile(OSLCompiler& compiler) { + ShaderOutput *alpha_out = output("Alpha"); + tex_mapping.compile(compiler); if(is_float == -1) @@ -370,6 +375,7 @@ void EnvironmentTextureNode::compile(OSLCompiler& compiler) else compiler.parameter("color_space", "sRGB"); compiler.parameter("is_float", is_float); + compiler.parameter("use_alpha", !alpha_out->links.empty()); compiler.add(this, "node_environment_texture"); } |