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:
authorThomas Dinges <blender@dingto.org>2014-01-14 01:01:39 +0400
committerThomas Dinges <blender@dingto.org>2014-01-14 01:01:39 +0400
commite9984653a827f1f5de8e1a1d019854b77afb1ea5 (patch)
treeee596503e06662ba9de59fa7170d0d3d0ef30b13 /intern/cycles/kernel/shaders
parent6b61f7f755011c0ceea89a31be218e1ed4940414 (diff)
Cycles: Fix Wave texture difference between OSL and SVM, OSL wasn't using the "Scale" properly for distortion.
Diffstat (limited to 'intern/cycles/kernel/shaders')
-rw-r--r--intern/cycles/kernel/shaders/node_wave_texture.osl12
1 files changed, 4 insertions, 8 deletions
diff --git a/intern/cycles/kernel/shaders/node_wave_texture.osl b/intern/cycles/kernel/shaders/node_wave_texture.osl
index 2de376c62f5..ba40207b446 100644
--- a/intern/cycles/kernel/shaders/node_wave_texture.osl
+++ b/intern/cycles/kernel/shaders/node_wave_texture.osl
@@ -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;
}