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@pandora.be>2013-05-10 15:44:24 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-10 15:44:24 +0400
commit34d73922974aba08e783839e0291aee59f4adc8c (patch)
tree4a7424a064e4b0ce97a7025cf6a5ba60c4d8c554 /intern/cycles/render/nodes.cpp
parente46551246ca305d0b723a7fb0e955e4852b1efdc (diff)
Fix #35282: cycles color ramp set to constant interpolation did not work well.
Diffstat (limited to 'intern/cycles/render/nodes.cpp')
-rw-r--r--intern/cycles/render/nodes.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index d996b108437..406b5876a4b 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -3175,6 +3175,8 @@ RGBRampNode::RGBRampNode()
add_input("Fac", SHADER_SOCKET_FLOAT);
add_output("Color", SHADER_SOCKET_COLOR);
add_output("Alpha", SHADER_SOCKET_FLOAT);
+
+ interpolate = true;
}
void RGBRampNode::compile(SVMCompiler& compiler)
@@ -3189,7 +3191,12 @@ void RGBRampNode::compile(SVMCompiler& compiler)
if(!alpha_out->links.empty())
compiler.stack_assign(alpha_out);
- compiler.add_node(NODE_RGB_RAMP, fac_in->stack_offset, color_out->stack_offset, alpha_out->stack_offset);
+ compiler.add_node(NODE_RGB_RAMP,
+ compiler.encode_uchar4(
+ fac_in->stack_offset,
+ color_out->stack_offset,
+ alpha_out->stack_offset),
+ interpolate);
compiler.add_array(ramp, RAMP_TABLE_SIZE);
}
@@ -3209,6 +3216,7 @@ void RGBRampNode::compile(OSLCompiler& compiler)
compiler.parameter_color_array("ramp_color", ramp_color, RAMP_TABLE_SIZE);
compiler.parameter_array("ramp_alpha", ramp_alpha, RAMP_TABLE_SIZE);
+ compiler.parameter("ramp_interpolate", interpolate);
compiler.add(this, "node_rgb_ramp");
}