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:
authorBartosz Moniewski <monio>2020-03-26 16:43:53 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-04-09 22:48:03 +0300
commit054950def946ed7638c2d9c18ef850cbba94d9d7 (patch)
tree6c38c89f8c04be9259a4246b5b0cd5e842951052 /intern/cycles/kernel/shaders/node_wave_texture.osl
parentf3433fcd3bf87c9405fb05c96fde036eb658e8aa (diff)
Shading: add Roughness input to Noise and Wave texture nodes
Currently in fractal_noise functions, each subsequent octave doubles the frequency and reduces the amplitude by half. This patch introduces Roughness input to Noise and Wave nodes. This multiplier determines how quickly the amplitudes of the subsequent octaves decrease. Value of 0.5 will be the default, generating identical noise we had before. Values above 0.5 will increase influence of each octave resulting in more "rough" noise, most interesting pattern changes happen there. Values below 0.5 will result in more "smooth" noise. Differential Revision: https://developer.blender.org/D7065
Diffstat (limited to 'intern/cycles/kernel/shaders/node_wave_texture.osl')
-rw-r--r--intern/cycles/kernel/shaders/node_wave_texture.osl9
1 files changed, 6 insertions, 3 deletions
diff --git a/intern/cycles/kernel/shaders/node_wave_texture.osl b/intern/cycles/kernel/shaders/node_wave_texture.osl
index f17397be243..874bfb8d3af 100644
--- a/intern/cycles/kernel/shaders/node_wave_texture.osl
+++ b/intern/cycles/kernel/shaders/node_wave_texture.osl
@@ -24,9 +24,10 @@ float wave(point p_input,
string bands_direction,
string rings_direction,
string profile,
- float detail,
float distortion,
+ float detail,
float dscale,
+ float droughness,
float phase)
{
/* Prevent precision issues on unit coordinates. */
@@ -67,7 +68,7 @@ float wave(point p_input,
n += phase;
if (distortion != 0.0) {
- n = n + (distortion * (fractal_noise(p * dscale, detail) * 2.0 - 1.0));
+ n = n + (distortion * (fractal_noise(p * dscale, detail, droughness) * 2.0 - 1.0));
}
if (profile == "sine") {
@@ -93,6 +94,7 @@ shader node_wave_texture(int use_mapping = 0,
float Distortion = 0.0,
float Detail = 2.0,
float DetailScale = 1.0,
+ float DetailRoughness = 0.5,
float PhaseOffset = 0.0,
point Vector = P,
output float Fac = 0.0,
@@ -108,9 +110,10 @@ shader node_wave_texture(int use_mapping = 0,
bands_direction,
rings_direction,
profile,
- Detail,
Distortion,
+ Detail,
DetailScale,
+ DetailRoughness,
PhaseOffset);
Color = Fac;
}