diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-04-06 12:11:28 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-04-06 12:11:28 +0300 |
commit | 3639a70eaec1d49e5634f2cd5f6d4ecb7d79ef14 (patch) | |
tree | f91662feb6d3e506898f3aa67a98272e33cea9f7 /intern | |
parent | a9bb8d8a73cad2edd96297c868ae3a3ab4b04e27 (diff) |
Fix T44222: Crash using pointiness attribute for volume shaders
This attribute is not really supported for volumes, so it get's converted to
constant 0 at shader compile time.
TODO: We should consider doing the same for tangent attribute in order to save
some annoying checks at tracing time.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/render/nodes.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index a62634efa42..40bb82c6330 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -2248,10 +2248,15 @@ void GeometryNode::compile(SVMCompiler& compiler) out = output("Pointiness"); if(!out->links.empty()) { compiler.stack_assign(out); - compiler.add_node(attr_node, - ATTR_STD_POINTINESS, - out->stack_offset, - NODE_ATTR_FLOAT); + if(compiler.output_type() != SHADER_TYPE_VOLUME) { + compiler.add_node(attr_node, + ATTR_STD_POINTINESS, + out->stack_offset, + NODE_ATTR_FLOAT); + } + else { + compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), out->stack_offset); + } } } |