diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-11-02 20:27:54 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-11-02 20:56:25 +0300 |
commit | 48e2a15160d276c8080cd8d4f6dc0ba752dbb410 (patch) | |
tree | 5552f66d7fa217a12bbdd4fbe0c1e9691c4fb36e /source/blender/nodes/shader | |
parent | 978f2cb900b75110a3bc9dbcec9d4aeae5df4565 (diff) |
Fix T77681, T92634: noise texture artifacts with high detail
We run into float precision issues here, clamp the number of octaves to
one less, which has little to no visual difference. This was empirically
determined to work up to 16 before, but with additional inputs like
roughness only 15 appears to work.
Also adds misisng clamp for the geometry nodes implementation.
Diffstat (limited to 'source/blender/nodes/shader')
3 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc index 3bf4e24ed53..81f9cd735eb 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc @@ -29,7 +29,7 @@ static void sh_node_tex_musgrave_declare(NodeDeclarationBuilder &b) b.add_input<decl::Vector>(N_("Vector")).hide_value().implicit_field(); b.add_input<decl::Float>(N_("W")).min(-1000.0f).max(1000.0f); b.add_input<decl::Float>(N_("Scale")).min(-1000.0f).max(1000.0f).default_value(5.0f); - b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(16.0f).default_value(2.0f); + b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(15.0f).default_value(2.0f); b.add_input<decl::Float>(N_("Dimension")).min(0.0f).max(1000.0f).default_value(2.0f); b.add_input<decl::Float>(N_("Lacunarity")).min(0.0f).max(1000.0f).default_value(2.0f); b.add_input<decl::Float>(N_("Offset")).min(-1000.0f).max(1000.0f); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc index 72892c32795..d28095edb96 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc @@ -29,7 +29,7 @@ static void sh_node_tex_noise_declare(NodeDeclarationBuilder &b) b.add_input<decl::Vector>(N_("Vector")).implicit_field(); b.add_input<decl::Float>(N_("W")).min(-1000.0f).max(1000.0f); b.add_input<decl::Float>(N_("Scale")).min(-1000.0f).max(1000.0f).default_value(5.0f); - b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(16.0f).default_value(2.0f); + b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(15.0f).default_value(2.0f); b.add_input<decl::Float>(N_("Roughness")) .min(0.0f) .max(1.0f) diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc b/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc index 144aa1885bd..fe534c605e9 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc @@ -29,7 +29,7 @@ static void sh_node_tex_wave_declare(NodeDeclarationBuilder &b) b.add_input<decl::Vector>(N_("Vector")).implicit_field(); b.add_input<decl::Float>(N_("Scale")).min(-1000.0f).max(1000.0f).default_value(5.0f); b.add_input<decl::Float>(N_("Distortion")).min(-1000.0f).max(1000.0f).default_value(0.0f); - b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(16.0f).default_value(2.0f); + b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(15.0f).default_value(2.0f); b.add_input<decl::Float>(N_("Detail Scale")).min(-1000.0f).max(1000.0f).default_value(1.0f); b.add_input<decl::Float>(N_("Detail Roughness")) .min(0.0f) |