diff options
author | Thomas Dinges <blender@dingto.org> | 2012-06-03 02:57:26 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2012-06-03 02:57:26 +0400 |
commit | a4f3475846cccc49d87e4f88b7df225ec566646e (patch) | |
tree | 3c60efde5ec7886d0dcffe16db7246067a84ec68 /intern/cycles/kernel | |
parent | f69cec4596f3444863a8c683dc64ed7c29824a94 (diff) |
Cycles / OSL Textures:
* More fixes, replaced all remaining size variables with scale ones.
* Remove nonzero check in OSL textures, not needed anymore, was there to prevent division by zero for the size variable.
Diffstat (limited to 'intern/cycles/kernel')
4 files changed, 7 insertions, 11 deletions
diff --git a/intern/cycles/kernel/osl/nodes/node_musgrave_texture.osl b/intern/cycles/kernel/osl/nodes/node_musgrave_texture.osl index fbd0ce5c3bd..3ab345279f1 100644 --- a/intern/cycles/kernel/osl/nodes/node_musgrave_texture.osl +++ b/intern/cycles/kernel/osl/nodes/node_musgrave_texture.osl @@ -193,16 +193,15 @@ shader node_musgrave_texture( float Offset = 0.0, float Intensity = 1.0, float Gain = 1.0, - float Size = 0.25, + float Scale = 5.0, point Vector = P, output float Fac = 0.0) { float dimension = max(Dimension, 0.0); float octaves = max(Octaves, 0.0); float lacunarity = max(Lacunarity, 1e-5); - float size = nonzero(Size, 1e-5); - point p = Vector/size; + point p = Vector*Scale; if(Type == "Multifractal") Fac = Intensity*noise_musgrave_multi_fractal(p, Basis, dimension, lacunarity, octaves); diff --git a/intern/cycles/kernel/osl/nodes/node_noise_texture.osl b/intern/cycles/kernel/osl/nodes/node_noise_texture.osl index bc5da0ca089..fd9fc1dedc0 100644 --- a/intern/cycles/kernel/osl/nodes/node_noise_texture.osl +++ b/intern/cycles/kernel/osl/nodes/node_noise_texture.osl @@ -46,7 +46,7 @@ float noise(point p, string basis, float distortion, float detail) */ } -shader node_distorted_noise_texture( +shader node_noise_texture( string Basis = "Perlin", float Distortion = 0.0, float Scale = 5.0, @@ -54,7 +54,6 @@ shader node_distorted_noise_texture( point Vector = P, output float Fac = 0.0) { - float scale = nonzero(Scale, 1e-5); - Fac = noise(Vector*scale, Basis, Distortion, Detail); + Fac = noise(Vector*Scale, Basis, Distortion, Detail); } diff --git a/intern/cycles/kernel/osl/nodes/node_voronoi_texture.osl b/intern/cycles/kernel/osl/nodes/node_voronoi_texture.osl index 140ba6a6ba1..f24f154be84 100644 --- a/intern/cycles/kernel/osl/nodes/node_voronoi_texture.osl +++ b/intern/cycles/kernel/osl/nodes/node_voronoi_texture.osl @@ -30,13 +30,12 @@ shader node_voronoi_texture( float Weight4 = 0.0, float Exponent = 2.5, float Intensity = 1.0, - float Size = 0.25, + float Scale = 5.0, point Vector = P, output float Fac = 0.0, output color Color = color(0.0, 0.0, 0.0)) { float exponent = max(Exponent, 1e-5); - float size = nonzero(Size, 1e-5); float aw1 = fabs(Weight1); float aw2 = fabs(Weight2); @@ -51,7 +50,7 @@ shader node_voronoi_texture( float da[4]; point pa[4]; - voronoi(Vector/size, DistanceMetric, exponent, da, pa); + voronoi(Vector*Scale, DistanceMetric, exponent, da, pa); /* Scalar output */ Fac = sc * fabs(Weight1*da[0] + Weight2*da[1] + Weight3*da[2] + Weight4*da[3]); diff --git a/intern/cycles/kernel/osl/nodes/node_wave_texture.osl b/intern/cycles/kernel/osl/nodes/node_wave_texture.osl index 29563660cdc..b55ec771be8 100644 --- a/intern/cycles/kernel/osl/nodes/node_wave_texture.osl +++ b/intern/cycles/kernel/osl/nodes/node_wave_texture.osl @@ -54,7 +54,6 @@ shader node_wave_texture( point Vector = P, output float Fac = 0.0) { - float scale = nonzero(Scale, 1e-5); - Fac = wave(Vector, scale, Type, detail, distortion, dscale); + Fac = wave(Vector, Scale, Type, detail, distortion, dscale); } |