Cycles: Fix Wave texture difference between OSL and SVM, OSL wasn't using the "Scale" properly for distortion.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user