diff options
author | Thomas Dinges <blender@dingto.org> | 2012-09-04 20:00:12 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2012-09-04 20:00:12 +0400 |
commit | f2caaaec9b67eb8ebe1d37c5903935af1c96ce39 (patch) | |
tree | c2c0a8fb2720047fbf608f3106f0a19d10ca3020 /intern | |
parent | 3d7fd3c1580f2b398bc96439b7c35673a517f058 (diff) |
OSL:
* WIP commit of fixes for musgrave and wave.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/osl/nodes/node_musgrave_texture.osl | 25 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/nodes/node_wave_texture.osl | 10 |
2 files changed, 20 insertions, 15 deletions
diff --git a/intern/cycles/kernel/osl/nodes/node_musgrave_texture.osl b/intern/cycles/kernel/osl/nodes/node_musgrave_texture.osl index 3ab345279f1..68f9873f103 100644 --- a/intern/cycles/kernel/osl/nodes/node_musgrave_texture.osl +++ b/intern/cycles/kernel/osl/nodes/node_musgrave_texture.osl @@ -186,32 +186,35 @@ float noise_musgrave_ridged_multi_fractal(point p, string basis, float H, float shader node_musgrave_texture( string Type = "fBM", - string Basis = "Perlin", float Dimension = 2.0, float Lacunarity = 1.0, - float Octaves = 2.0, + float Detail = 2.0, float Offset = 0.0, - float Intensity = 1.0, float Gain = 1.0, float Scale = 5.0, point Vector = P, - output float Fac = 0.0) + output float Fac = 0.0, + output color Color = color(0.0, 0.0, 0.0)) { - float dimension = max(Dimension, 0.0); - float octaves = max(Octaves, 0.0); + float dimension = max(Dimension, 1e-5); + float octaves = clamp(Detail, 0.0, 16.0); float lacunarity = max(Lacunarity, 1e-5); + string Basis = "Perlin" + float intensity = 1.0; point p = Vector*Scale; if(Type == "Multifractal") - Fac = Intensity*noise_musgrave_multi_fractal(p, Basis, dimension, lacunarity, octaves); + Fac = intensity*noise_musgrave_multi_fractal(p, Basis, dimension, lacunarity, octaves); else if(Type == "fBM") - Fac = Intensity*noise_musgrave_fBm(p, Basis, dimension, lacunarity, octaves); + Fac = intensity*noise_musgrave_fBm(p, Basis, dimension, lacunarity, octaves); else if(Type == "Hybrid Multifractal") - Fac = Intensity*noise_musgrave_hybrid_multi_fractal(p, Basis, dimension, lacunarity, octaves, Offset, Gain); + Fac = intensity*noise_musgrave_hybrid_multi_fractal(p, Basis, dimension, lacunarity, octaves, Offset, Gain); else if(Type == "Ridged Multifractal") - Fac = Intensity*noise_musgrave_ridged_multi_fractal(p, Basis, dimension, lacunarity, octaves, Offset, Gain); + Fac = intensity*noise_musgrave_ridged_multi_fractal(p, Basis, dimension, lacunarity, octaves, Offset, Gain); else if(Type == "Hetero Terrain") - Fac = Intensity*noise_musgrave_hetero_terrain(p, Basis, dimension, lacunarity, octaves, Offset); + Fac = intensity*noise_musgrave_hetero_terrain(p, Basis, dimension, lacunarity, octaves, Offset); + + Color = color(Fac, Fac, Fac); } diff --git a/intern/cycles/kernel/osl/nodes/node_wave_texture.osl b/intern/cycles/kernel/osl/nodes/node_wave_texture.osl index 693f09ae24c..226dd3405c2 100644 --- a/intern/cycles/kernel/osl/nodes/node_wave_texture.osl +++ b/intern/cycles/kernel/osl/nodes/node_wave_texture.osl @@ -48,12 +48,14 @@ float wave(point p, float scale, string type, float detail, float distortion, fl shader node_wave_texture( string Type = "Bands", float Scale = 5.0, - float distortion = 0.0, - float detail = 2.0, + float Distortion = 0.0, + float Detail = 2.0, float dscale = 1.0, point Vector = P, - output float Fac = 0.0) + output float Fac = 0.0, + output color Color = color (0.0, 0.0, 0.0)) { - Fac = wave(Vector, Scale, Type, detail, distortion, dscale); + Fac = wave(Vector, Scale, Type, Detail, Distortion, dscale); + Color = color(Fac, Fac, Fac); } |