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>2013-02-04 15:23:40 +0400
committerThomas Dinges <blender@dingto.org>2013-02-04 15:23:40 +0400
commite3784a27d6372858411ce257df6bff8984509702 (patch)
tree185a8c527e728c8385c06c1f68558f719fb37b22 /intern/cycles/kernel/shaders/node_texture.h
parentb2f6c49830ca4e306b92b7b26037217f286bb371 (diff)
Cycles / OSL:
* Fix for r53689, there are two noise types, signed and unsigned. Caused Musgrave Texture to render differently compared to SVM backend.
Diffstat (limited to 'intern/cycles/kernel/shaders/node_texture.h')
-rw-r--r--intern/cycles/kernel/shaders/node_texture.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/intern/cycles/kernel/shaders/node_texture.h b/intern/cycles/kernel/shaders/node_texture.h
index 2de0fc0ea57..463c68a6c27 100644
--- a/intern/cycles/kernel/shaders/node_texture.h
+++ b/intern/cycles/kernel/shaders/node_texture.h
@@ -151,9 +151,17 @@ float voronoi_CrS(point p) { return 2.0 * voronoi_Cr(p) - 1.0; }
/* Noise Bases */
-float safe_noise(point p)
+float safe_noise(point p, int type)
{
- float f = noise(p);
+ float f = 0.0;
+
+ /* Perlin noise in range -1..1 */
+ if (type == 0)
+ f = noise("perlin", p);
+
+ /* Perlin noise in range 0..1 */
+ else
+ f = noise(p);
/* can happen for big coordinates, things even out to 0.5 then anyway */
if(!isfinite(f))
@@ -167,7 +175,7 @@ float noise_basis(point p, string basis)
float result = 0.0;
if (basis == "Perlin")
- result = safe_noise(p); /* returns perlin noise in range 0..1 */
+ result = safe_noise(p, 1);
if (basis == "Voronoi F1")
result = voronoi_F1S(p);
if (basis == "Voronoi F2")