Merged revision(s) 57587-57670 from trunk/blender into soc-2013-dingto
[blender.git] / intern / cycles / render / nodes.cpp
index f215d9e75be2a89379145c7e620af70a508950cf..038b9c24b8a4f59bf99ab9971407520d001f9e1f 100644 (file)
@@ -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");
 }