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>2013-12-31 20:33:55 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-31 21:03:22 +0400
commitaaabac069fbf1454e7c7b00a1e96783ecf1563cd (patch)
treee6879ce03d2be652fe3105fe090eafd6fe567776 /intern/cycles/render/graph.cpp
parent9cd2b199994ba48f343a89a270827b2e0ed3221d (diff)
Cycles Volume Render: these changes should have included in the last commit.
Diffstat (limited to 'intern/cycles/render/graph.cpp')
-rw-r--r--intern/cycles/render/graph.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 4256c5ed95b..3fae5244488 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -17,6 +17,7 @@
#include "attribute.h"
#include "graph.h"
#include "nodes.h"
+#include "shader.h"
#include "util_algorithm.h"
#include "util_debug.h"
@@ -121,11 +122,15 @@ void ShaderNode::attributes(Shader *shader, AttributeRequestSet *attributes)
foreach(ShaderInput *input, inputs) {
if(!input->link) {
if(input->default_value == ShaderInput::TEXTURE_GENERATED) {
- attributes->add(ATTR_STD_GENERATED);
- attributes->add(ATTR_STD_GENERATED_TRANSFORM); // XXX only for volumes!
+ if(shader->has_surface)
+ attributes->add(ATTR_STD_GENERATED);
+ if(shader->has_volume)
+ attributes->add(ATTR_STD_GENERATED_TRANSFORM);
+ }
+ else if(input->default_value == ShaderInput::TEXTURE_UV) {
+ if(shader->has_surface)
+ attributes->add(ATTR_STD_UV);
}
- else if(input->default_value == ShaderInput::TEXTURE_UV)
- attributes->add(ATTR_STD_UV);
}
}
}