[Bf-blender-cvs] [3639a70] master: Fix T44222: Crash using pointiness attribute for volume shaders
Sergey Sharybin
noreply at git.blender.org
Mon Apr 6 11:22:28 CEST 2015
Commit: 3639a70eaec1d49e5634f2cd5f6d4ecb7d79ef14
Author: Sergey Sharybin
Date: Mon Apr 6 14:11:28 2015 +0500
Branches: master
https://developer.blender.org/rB3639a70eaec1d49e5634f2cd5f6d4ecb7d79ef14
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.
===================================================================
M intern/cycles/render/nodes.cpp
===================================================================
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index a62634e..40bb82c 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);
+ }
}
}
More information about the Bf-blender-cvs
mailing list