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 /source/blender/gpu/shaders/material/gpu_shader_material_tex_wave.glsl
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 'source/blender/gpu/shaders/material/gpu_shader_material_tex_wave.glsl')
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_tex_wave.glsl5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_tex_wave.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_tex_wave.glsl
index c72f9717af3..070f42a5e30 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_tex_wave.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_tex_wave.glsl
@@ -2,6 +2,7 @@ float calc_wave(vec3 p,
float distortion,
float detail,
float detail_scale,
+ float detail_roughness,
float phase,
int wave_type,
int bands_dir,
@@ -46,7 +47,7 @@ float calc_wave(vec3 p,
n += phase;
if (distortion != 0.0) {
- n += distortion * (fractal_noise(p * detail_scale, detail) * 2.0 - 1.0);
+ n += distortion * (fractal_noise(p * detail_scale, detail, detail_roughness) * 2.0 - 1.0);
}
if (wave_profile == 0) { /* profile sin */
@@ -67,6 +68,7 @@ void node_tex_wave(vec3 co,
float distortion,
float detail,
float detail_scale,
+ float detail_roughness,
float phase,
float wave_type,
float bands_dir,
@@ -80,6 +82,7 @@ void node_tex_wave(vec3 co,
distortion,
detail,
detail_scale,
+ detail_roughness,
phase,
int(wave_type),
int(bands_dir),