Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit legacy materials #1398

Merged
merged 8 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
333 changes: 333 additions & 0 deletions contrib/adsk/libraries/adsklib/adsklib_legacy_defs.mtlx

Large diffs are not rendered by default.

2,219 changes: 2,219 additions & 0 deletions contrib/adsk/libraries/adsklib/adsklib_legacy_ng.mtlx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
-->
<!-- <backface_util> -->
<implementation name="IM_backface_util_genglsl" nodedef="adsk:ND_backface_util" file="mx_backface_util.glsl" function="mx_backface_util" target="genglsl"/>

<implementation name="IM_turbulence2d_float_genglsl" nodedef="ND_turbulence2d_float" file="mx_turbulence2d_float.glsl" function="mx_turbulence2d_float" target="genglsl" />
<implementation name="IM_turbulence3d_float_genglsl" nodedef="ND_turbulence3d_float" file="mx_turbulence3d_float.glsl" function="mx_turbulence3d_float" target="genglsl" />
Comment on lines +11 to +12

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we already determine that the noise functions in question here are not available through the existing stdlib noise()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the current stdlib noise types are Perlin, Cell, Worley and Fractal


</materialx>
23 changes: 23 additions & 0 deletions contrib/adsk/libraries/adsklib/genglsl/mx_turbulence2d_float.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "../../stdlib/genglsl/lib/mx_noise.glsl"
nicolassavva-autodesk marked this conversation as resolved.
Show resolved Hide resolved

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;
}
23 changes: 23 additions & 0 deletions contrib/adsk/libraries/adsklib/genglsl/mx_turbulence3d_float.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "../../stdlib/genglsl/lib/mx_noise.glsl"
nicolassavva-autodesk marked this conversation as resolved.
Show resolved Hide resolved

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;
}

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading