From e7696dd1608a0cd195586ce3d225212fe39fe91c Mon Sep 17 00:00:00 2001 From: Roberto Ziche Date: Fri, 6 Dec 2024 14:36:05 -0800 Subject: [PATCH] Updating noise related graphs This commit: - Removes the existing turbulence noise 2d/3d implemented in glsl and also some placeholders for mdl/osl - Introduces two new turbulence noise 2d/3d based on graphs, with an iteration/octaves limit set to 8 - Introduces two new fractal noise 2d/3d based on graphs too, with an octaves float input and the same 8 iteration limit as turbulence - Replaces legacy_noise with a new version using the new fractal and turbulence noises - Adjusts some input default values in nodedefs - Changes a few node names that were inconsistent (like "legacy_marble_color3" to "legacy_marble") Many changes due to LookdevX use (coordinates, mainly) dirty the diffs a bit. Git seems to have a hard time grouping changes properly. The LookdevX Maya file will be posted separately. --- .../adsklib/adsklib_legacy_defs.mtlx | 46 +- .../libraries/adsklib/adsklib_legacy_ng.mtlx | 1142 +++++++++++++++-- .../adsklib/genglsl/adsklib_genglsl_impl.mtlx | 3 - .../genglsl/mx_turbulence2d_float.glsl | 23 - .../genglsl/mx_turbulence3d_float.glsl | 23 - .../adsklib/genmdl/adsklib_genmdl_impl.mtlx | 3 - .../adsklib/genosl/adsklib_genosl_impl.mtlx | 3 - .../adsklib/genosl/mx_turbulence2d_float.osl | 4 - .../adsklib/genosl/mx_turbulence3d_float.osl | 4 - 9 files changed, 1040 insertions(+), 211 deletions(-) delete mode 100644 contrib/adsk/libraries/adsklib/genglsl/mx_turbulence2d_float.glsl delete mode 100644 contrib/adsk/libraries/adsklib/genglsl/mx_turbulence3d_float.glsl delete mode 100644 contrib/adsk/libraries/adsklib/genosl/mx_turbulence2d_float.osl delete mode 100644 contrib/adsk/libraries/adsklib/genosl/mx_turbulence3d_float.osl diff --git a/contrib/adsk/libraries/adsklib/adsklib_legacy_defs.mtlx b/contrib/adsk/libraries/adsklib/adsklib_legacy_defs.mtlx index 6abe2aac2e..6247679cd8 100644 --- a/contrib/adsk/libraries/adsklib/adsklib_legacy_defs.mtlx +++ b/contrib/adsk/libraries/adsklib/adsklib_legacy_defs.mtlx @@ -67,9 +67,9 @@ - - - + + + @@ -80,29 +80,43 @@ - - - - + + - + + + - - - + - + + + + + + + + + + + + + + + + + - - - + + + @@ -115,7 +129,7 @@ - + diff --git a/contrib/adsk/libraries/adsklib/adsklib_legacy_ng.mtlx b/contrib/adsk/libraries/adsklib/adsklib_legacy_ng.mtlx index 9277f00331..84fc943cae 100644 --- a/contrib/adsk/libraries/adsklib/adsklib_legacy_ng.mtlx +++ b/contrib/adsk/libraries/adsklib/adsklib_legacy_ng.mtlx @@ -429,91 +429,971 @@ - - + + + - - - - - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -539,7 +1419,7 @@ - + @@ -560,7 +1440,7 @@ - + @@ -568,8 +1448,8 @@ - - + + @@ -577,218 +1457,216 @@ - + - + - + - + - - + + - - + + - - + + - - + + - + - - + + - + - - + + - + - + - + - - + + - + - + - - - - - - - + + + + + + + - + - + - - - - + + + + + - - - - - + - + - + - + - + - - - - - - - - - + - + - + + + + + - + - + - + - + - - - - - - - - + + + + + - + - + - + - + - - - - - + + - - + + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + diff --git a/contrib/adsk/libraries/adsklib/genglsl/adsklib_genglsl_impl.mtlx b/contrib/adsk/libraries/adsklib/genglsl/adsklib_genglsl_impl.mtlx index 55b209a7d9..8a6e2d0ec4 100644 --- a/contrib/adsk/libraries/adsklib/genglsl/adsklib_genglsl_impl.mtlx +++ b/contrib/adsk/libraries/adsklib/genglsl/adsklib_genglsl_impl.mtlx @@ -8,7 +8,4 @@ - - - diff --git a/contrib/adsk/libraries/adsklib/genglsl/mx_turbulence2d_float.glsl b/contrib/adsk/libraries/adsklib/genglsl/mx_turbulence2d_float.glsl deleted file mode 100644 index 450ce03e5c..0000000000 --- a/contrib/adsk/libraries/adsklib/genglsl/mx_turbulence2d_float.glsl +++ /dev/null @@ -1,23 +0,0 @@ -#include "../../stdlib/genglsl/lib/mx_noise.glsl" - -void mx_turbulence2d_float(float amplitude, float octaves, vec2 texcoord, out float result) -{ - float sum = 0.0; - float scale = 1.0; - - // Accumulate the required number of octaves of noise. - float i = 0.0; - for (i = octaves; i >= 1.0; i -= 1.0) { - float value = mx_perlin_noise_float(texcoord * scale) / scale; - sum += abs(value); - scale *= 2.0; - } - - // Add a portion of the remaining octave, if any. - if (i > 0.0) { - float value = mx_perlin_noise_float(texcoord * scale) / scale; - sum += abs(value) * i; - } - - result = sum * amplitude; -} diff --git a/contrib/adsk/libraries/adsklib/genglsl/mx_turbulence3d_float.glsl b/contrib/adsk/libraries/adsklib/genglsl/mx_turbulence3d_float.glsl deleted file mode 100644 index 7ebce11c38..0000000000 --- a/contrib/adsk/libraries/adsklib/genglsl/mx_turbulence3d_float.glsl +++ /dev/null @@ -1,23 +0,0 @@ -#include "../../stdlib/genglsl/lib/mx_noise.glsl" - -void mx_turbulence3d_float(float amplitude, float octaves, vec3 position, out float result) -{ - float sum = 0.0; - float scale = 1.0; - - // Accumulate the required number of octaves of noise. - float i = 0.0; - for (i = octaves; i >= 1.0; i -= 1.0) { - float value = mx_perlin_noise_float(position * scale) / scale; - sum += abs(value); - scale *= 2.0; - } - - // Add a portion of the remaining octave, if any. - if (i > 0.0) { - float value = mx_perlin_noise_float(position * scale) / scale; - sum += abs(value) * i; - } - - result = sum * amplitude; -} diff --git a/contrib/adsk/libraries/adsklib/genmdl/adsklib_genmdl_impl.mtlx b/contrib/adsk/libraries/adsklib/genmdl/adsklib_genmdl_impl.mtlx index f6ef06138b..4c7bfaaf78 100644 --- a/contrib/adsk/libraries/adsklib/genmdl/adsklib_genmdl_impl.mtlx +++ b/contrib/adsk/libraries/adsklib/genmdl/adsklib_genmdl_impl.mtlx @@ -9,7 +9,4 @@ - - - diff --git a/contrib/adsk/libraries/adsklib/genosl/adsklib_genosl_impl.mtlx b/contrib/adsk/libraries/adsklib/genosl/adsklib_genosl_impl.mtlx index 821e3b8180..0779a428fd 100644 --- a/contrib/adsk/libraries/adsklib/genosl/adsklib_genosl_impl.mtlx +++ b/contrib/adsk/libraries/adsklib/genosl/adsklib_genosl_impl.mtlx @@ -9,7 +9,4 @@ - - - diff --git a/contrib/adsk/libraries/adsklib/genosl/mx_turbulence2d_float.osl b/contrib/adsk/libraries/adsklib/genosl/mx_turbulence2d_float.osl deleted file mode 100644 index 45c9f4371a..0000000000 --- a/contrib/adsk/libraries/adsklib/genosl/mx_turbulence2d_float.osl +++ /dev/null @@ -1,4 +0,0 @@ -void mx_turbulence2d_float(float amplitude, float octaves, vector2 texcoord, output float result) -{ - result = 0.5; -} diff --git a/contrib/adsk/libraries/adsklib/genosl/mx_turbulence3d_float.osl b/contrib/adsk/libraries/adsklib/genosl/mx_turbulence3d_float.osl deleted file mode 100644 index 1b7e3dcb33..0000000000 --- a/contrib/adsk/libraries/adsklib/genosl/mx_turbulence3d_float.osl +++ /dev/null @@ -1,4 +0,0 @@ -void mx_turbulence3d_float(float amplitude, float octaves, vector position, output float result) -{ - result = 0.5; -}