Cycles: Fix Wave texture difference between OSL and SVM, OSL wasn't using the "Scale" properly for distortion.

This commit is contained in:
Thomas Dinges
2014-01-13 22:01:39 +01:00
parent 6b61f7f755
commit e9984653a8
2 changed files with 6 additions and 12 deletions

View File

@@ -19,19 +19,15 @@
/* Wave */
float wave(point p, float scale, string type, float detail, float distortion, float dscale)
float wave(point p, string type, float detail, float distortion, float dscale)
{
float x = p[0] * scale;
float y = p[1] * scale;
float z = p[2] * scale;
float n = 0.0;
if (type == "Bands") {
n = (x + y + z) * 10.0;
n = (p[0] + p[1] + p[2]) * 10.0;
}
else if (type == "Rings") {
n = (sqrt(x * x + y * y + z * z) * 20.0);
n = length(p) * 20.0;
}
if (distortion != 0.0) {
@@ -57,7 +53,7 @@ shader node_wave_texture(
if (use_mapping)
p = transform(mapping, p);
Fac = wave(p, Scale, Type, Detail, Distortion, DetailScale);
Fac = wave(p * Scale, Type, Detail, Distortion, DetailScale);
Color = Fac;
}