Fix #35282: cycles color ramp set to constant interpolation did not work well.

This commit is contained in:
Brecht Van Lommel
2013-05-10 11:44:24 +00:00
parent e46551246c
commit 34d7392297
5 changed files with 26 additions and 14 deletions

View File

@@ -22,6 +22,7 @@
shader node_rgb_ramp(
color ramp_color[RAMP_TABLE_SIZE] = {0.0},
float ramp_alpha[RAMP_TABLE_SIZE] = {0.0},
int ramp_interpolate = 1,
float Fac = 0.0,
output color Color = 0.0,
@@ -38,7 +39,7 @@ shader node_rgb_ramp(
Color = ramp_color[i];
Alpha = ramp_alpha[i];
if (t > 0.0) {
if (ramp_interpolate && t > 0.0) {
Color = (1.0 - t) * Color + t * ramp_color[i + 1];
Alpha = (1.0 - t) * Alpha + t * ramp_alpha[i + 1];
}