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

Add <fractal2d> node #2183

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
12 changes: 0 additions & 12 deletions documents/Specification/MaterialX.Proposals.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,6 @@ Inheritance of material-type custom nodes is also allowed, so that new or change

### Noise Nodes

<a id="node-fractal2d"> </a>

We have a standard 3d fractal noise, but a 2d variant would be useful as well.

* **`fractal2d`**: Zero-centered 2D Fractal noise in 1, 2, 3 or 4 channels, created by summing several octaves of 2D Perlin noise, increasing the frequency and decreasing the amplitude at each octave.
* `amplitude` (float or vector<em>N</em>): the center-to-peak amplitude of the noise (peak-to-peak amplitude is 2x this value). Default is 1.0.
* `octaves` (integer): the number of octaves of noise to be summed. Default is 3.
* `lacunarity` (float or vector<em>N</em>): the exponential scale between successive octaves of noise; must be an integer value if period is non-zero so the result is properly tileable. VectorN-output types can provide either a float (isotropic) or vector<em>N</em> (anisotropic) values for lacunarity and diminish. Default is 2.0.
* `diminish` (float or vector<em>N</em>): the rate at which noise amplitude is diminished for each octave. Should be between 0.0 and 1.0; default is 0.5. VectorN-output types can provide either a float (isotropic) or vector<em>N</em> (anisotropic) values for lacunarity and diminish.
* `period` (float or vector<em>N</em>): the positive integer distance at which the noise function returns the same value for texture coordinates repeated at that step. Default is 0, meaning the noise is not periodic.
* `texcoord` (vector2): the 2D texture coordinate at which the noise is evaluated. Default is to use the first set of texture coordinates.

<a id="node-cellnoise1d"> </a>

1D Cell noise was proposed an an alternative approach to random value generation.
Expand Down
14 changes: 9 additions & 5 deletions documents/Specification/MaterialX.Specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -852,37 +852,41 @@ Standard Noise nodes:
* **`noise2d`**: 2D Perlin noise in 1, 2, 3 or 4 channels.
* `amplitude` (float or vector<em>N</em>): the center-to-peak amplitude of the noise (peak-to-peak amplitude is 2x this value). Default is 1.0.
* `pivot` (float): the center value of the output noise; effectively, this value is added to the result after the Perlin noise is multiplied by `amplitude`. Default is 0.0.
* `period` (float or vector<em>N</em>): the positive integer distance at which the noise function returns the same value for texture coordinates repeated at that step. Default is 0, meaning the noise is not periodic.
* `texcoord` (vector2): the 2D texture coordinate at which the noise is evaluated. Default is to use the first set of texture coordinates.

<a id="node-noise3d"> </a>

* **`noise3d`**: 3D Perlin noise in 1, 2, 3 or 4 channels.
* `amplitude` (float or vector<em>N</em>): the center-to-peak amplitude of the noise (peak-to-peak amplitude is 2x this value). Default is 1.0.
* `pivot` (float): the center value of the output noise; effectively, this value is added to the result after the Perlin noise is multiplied by `amplitude`. Default is 0.0.
* `period` (float or vector<em>N</em>): the positive integer distance at which the noise function returns the same value for position coordinates repeated at that step. Default is 0, meaning the noise is not periodic.
* `position` (vector3): the 3D position at which the noise is evaluated. Default is to use the current 3D object-space coordinate.

<a id="node-fractal2d"> </a>

* **`fractal2d`**: Zero-centered 2D Fractal noise in 1, 2, 3 or 4 channels, created by summing several octaves of 2D Perlin noise, increasing the frequency and decreasing the amplitude at each octave.
* `amplitude` (float or vector<em>N</em>): the center-to-peak amplitude of the noise (peak-to-peak amplitude is 2x this value). Default is 1.0.
* `octaves` (integer): the number of octaves of noise to be summed. Default is 3.
* `lacunarity` (float or vector<em>N</em>): the exponential scale between successive octaves of noise; must be an integer value if period is non-zero so the result is properly tileable. Default is 2.0. Vector<em>N</em>-output types can provide either a float (isotropic) or vector<em>N</em> (anisotropic) values for `lacunarity` and `diminish`.
* `diminish` (float or vector<em>N</em>): the rate at which noise amplitude is diminished for each octave. Should be between 0.0 and 1.0; default is 0.5. Vector<em>N</em>-output types can provide either a float (isotropic) or vector<em>N</em> (anisotropic) values for `lacunarity` and `diminish`.
* `texcoord` (vector2): the 2D texture coordinate at which the noise is evaluated. Default is to use the first set of texture coordinates.

<a id="node-fractal3d"> </a>

* **`fractal3d`**: Zero-centered 3D Fractal noise in 1, 2, 3 or 4 channels, created by summing several octaves of 3D Perlin noise, increasing the frequency and decreasing the amplitude at each octave.
* `amplitude` (float or vector<em>N</em>): the center-to-peak amplitude of the noise (peak-to-peak amplitude is 2x this value). Default is 1.0.
* `octaves` (integer): the number of octaves of noise to be summed. Default is 3.
* `lacunarity` (float or vector<em>N</em>): the exponential scale between successive octaves of noise; must be an integer value if period is non-zero so the result is properly tileable. Default is 2.0. Vector<em>N</em>-output types can provide either a float (isotropic) or vector<em>N</em> (anisotropic) values for `lacunarity` and `diminish`.
* `diminish` (float or vector<em>N</em>): the rate at which noise amplitude is diminished for each octave. Should be between 0.0 and 1.0; default is 0.5. Vector<em>N</em>-output types can provide either a float (isotropic) or vector<em>N</em> (anisotropic) values for `lacunarity` and `diminish`.
* `period` (float or vector<em>N</em>): the positive integer distance at which the noise function returns the same value for position coordinates repeated at that step. Default is 0, meaning the noise is not periodic.
* `position` (vector3): the 3D position at which the noise is evaluated. Default is to use the current 3D object-space coordinate.

<a id="node-cellnoise2d"> </a>

* **`cellnoise2d`**: 2D cellular noise, 1 or 3 channels (type float or vector3).
* `period` (float or vector3): the positive integer distance at which the noise function returns the same value for texture coordinates repeated at that step. Default is 0, meaning the noise is not periodic.
* `texcoord` (vector2): the 2D position at which the noise is evaluated. Default is to use the first set of texture coordinates.

<a id="node-cellnoise3d"> </a>

* **`cellnoise3d`**: 3D cellular noise, 1 or 3 channels (type float or vector3).
* `period` (float or vector3): the positive integer distance at which the noise function returns the same value for position coordinates repeated at that step. Default is 0, meaning the noise is not periodic.
* `position` (vector3): the 3D position at which the noise is evaluated. Default is to use the current 3D object-space coordinate.

<a id="node-worleynoise2d"> </a>
Expand Down
76 changes: 68 additions & 8 deletions libraries/stdlib/genglsl/lib/mx_noise.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ vec3 mx_cell_noise_vec3(vec4 p)
);
}

float mx_fractal_noise_float(vec3 p, int octaves, float lacunarity, float diminish)
float mx_fractal2d_noise_float(vec2 p, int octaves, float lacunarity, float diminish)
{
float result = 0.0;
float amplitude = 1.0;
Expand All @@ -411,7 +411,7 @@ float mx_fractal_noise_float(vec3 p, int octaves, float lacunarity, float dimini
return result;
}

vec3 mx_fractal_noise_vec3(vec3 p, int octaves, float lacunarity, float diminish)
vec3 mx_fractal2d_noise_vec3(vec2 p, int octaves, float lacunarity, float diminish)
{
vec3 result = vec3(0.0);
float amplitude = 1.0;
Expand All @@ -424,19 +424,79 @@ vec3 mx_fractal_noise_vec3(vec3 p, int octaves, float lacunarity, float diminish
return result;
}

vec2 mx_fractal_noise_vec2(vec3 p, int octaves, float lacunarity, float diminish)
vec2 mx_fractal2d_noise_vec2(vec2 p, int octaves, float lacunarity, float diminish)
{
return vec2(mx_fractal_noise_float(p, octaves, lacunarity, diminish),
mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish));
return vec2(mx_fractal2d_noise_float(p, octaves, lacunarity, diminish),
mx_fractal2d_noise_float(p+vec2(19, 193), octaves, lacunarity, diminish));
}

vec4 mx_fractal_noise_vec4(vec3 p, int octaves, float lacunarity, float diminish)
vec4 mx_fractal2d_noise_vec4(vec2 p, int octaves, float lacunarity, float diminish)
{
vec3 c = mx_fractal2d_noise_vec3(p, octaves, lacunarity, diminish);
float f = mx_fractal2d_noise_float(p+vec2(19, 193), octaves, lacunarity, diminish);
return vec4(c, f);
}

float mx_fractal3d_noise_float(vec3 p, int octaves, float lacunarity, float diminish)
{
float result = 0.0;
float amplitude = 1.0;
for (int i = 0; i < octaves; ++i)
{
result += amplitude * mx_perlin_noise_float(p);
amplitude *= diminish;
p *= lacunarity;
}
return result;
}

vec3 mx_fractal3d_noise_vec3(vec3 p, int octaves, float lacunarity, float diminish)
{
vec3 result = vec3(0.0);
float amplitude = 1.0;
for (int i = 0; i < octaves; ++i)
{
result += amplitude * mx_perlin_noise_vec3(p);
amplitude *= diminish;
p *= lacunarity;
}
return result;
}

vec2 mx_fractal3d_noise_vec2(vec3 p, int octaves, float lacunarity, float diminish)
{
return vec2(mx_fractal3d_noise_float(p, octaves, lacunarity, diminish),
mx_fractal3d_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish));
}

vec4 mx_fractal3d_noise_vec4(vec3 p, int octaves, float lacunarity, float diminish)
{
vec3 c = mx_fractal_noise_vec3(p, octaves, lacunarity, diminish);
float f = mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish);
vec3 c = mx_fractal3d_noise_vec3(p, octaves, lacunarity, diminish);
float f = mx_fractal3d_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish);
return vec4(c, f);
}

// These wrappers are provided as a backwards compatible shim after renaming mx_fractal_noise_float() to
// mx_fractal3d_noise_float() when mx_fractal2d_noise_float() was added.
// These should be considered deprecated and should be removed in a future API "breaking" release of
// MaterialX.
float mx_fractal_noise_float(vec3 p, int octaves, float lacunarity, float diminish)
{
return mx_fractal3d_noise_float(p, octaves, lacunarity, diminish);
}
vec3 mx_fractal_noise_vec3(vec3 p, int octaves, float lacunarity, float diminish)
{
return mx_fractal3d_noise_vec3(p, octaves, lacunarity, diminish);
}
vec2 mx_fractal_noise_vec2(vec3 p, int octaves, float lacunarity, float diminish)
{
return mx_fractal3d_noise_vec2(p, octaves, lacunarity, diminish);
}
vec4 mx_fractal_noise_vec4(vec3 p, int octaves, float lacunarity, float diminish)
{
return mx_fractal3d_noise_vec4(p, octaves, lacunarity, diminish);
}

vec2 mx_worley_cell_position(int x, int y, int xoff, int yoff, float jitter)
{
vec3 tmp = mx_cell_noise_vec3(vec2(x+xoff, y+yoff));
Expand Down
7 changes: 7 additions & 0 deletions libraries/stdlib/genglsl/mx_fractal2d_float.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "lib/mx_noise.glsl"

void mx_fractal2d_float(float amplitude, int octaves, float lacunarity, float diminish, vec2 texcoord, out float result)
{
float value = mx_fractal2d_noise_float(texcoord, octaves, lacunarity, diminish);
result = value * amplitude;
}
7 changes: 7 additions & 0 deletions libraries/stdlib/genglsl/mx_fractal2d_vector2.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "lib/mx_noise.glsl"

void mx_fractal2d_vector2(vec2 amplitude, int octaves, float lacunarity, float diminish, vec2 texcoord, out vec2 result)
{
vec2 value = mx_fractal2d_noise_vec2(texcoord, octaves, lacunarity, diminish);
result = value * amplitude;
}
7 changes: 7 additions & 0 deletions libraries/stdlib/genglsl/mx_fractal2d_vector3.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "lib/mx_noise.glsl"

void mx_fractal2d_vector3(vec3 amplitude, int octaves, float lacunarity, float diminish, vec2 texcoord, out vec3 result)
{
vec3 value = mx_fractal2d_noise_vec3(texcoord, octaves, lacunarity, diminish);
result = value * amplitude;
}
7 changes: 7 additions & 0 deletions libraries/stdlib/genglsl/mx_fractal2d_vector4.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "lib/mx_noise.glsl"

void mx_fractal2d_vector4(vec4 amplitude, int octaves, float lacunarity, float diminish, vec2 texcoord, out vec4 result)
{
vec4 value = mx_fractal2d_noise_vec4(texcoord, octaves, lacunarity, diminish);
result = value * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genglsl/mx_fractal3d_float.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vec3 position, out float result)
{
float value = mx_fractal_noise_float(position, octaves, lacunarity, diminish);
float value = mx_fractal3d_noise_float(position, octaves, lacunarity, diminish);
result = value * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genglsl/mx_fractal3d_vector2.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

void mx_fractal3d_vector2(vec2 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec2 result)
{
vec2 value = mx_fractal_noise_vec2(position, octaves, lacunarity, diminish);
vec2 value = mx_fractal3d_noise_vec2(position, octaves, lacunarity, diminish);
result = value * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genglsl/mx_fractal3d_vector3.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

void mx_fractal3d_vector3(vec3 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec3 result)
{
vec3 value = mx_fractal_noise_vec3(position, octaves, lacunarity, diminish);
vec3 value = mx_fractal3d_noise_vec3(position, octaves, lacunarity, diminish);
result = value * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genglsl/mx_fractal3d_vector4.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

void mx_fractal3d_vector4(vec4 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec4 result)
{
vec4 value = mx_fractal_noise_vec4(position, octaves, lacunarity, diminish);
vec4 value = mx_fractal3d_noise_vec4(position, octaves, lacunarity, diminish);
result = value * amplitude;
}
6 changes: 6 additions & 0 deletions libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@
<implementation name="IM_noise3d_vector3_genglsl" nodedef="ND_noise3d_vector3" file="mx_noise3d_vector3.glsl" function="mx_noise3d_vector3" target="genglsl" />
<implementation name="IM_noise3d_vector4_genglsl" nodedef="ND_noise3d_vector4" file="mx_noise3d_vector4.glsl" function="mx_noise3d_vector4" target="genglsl" />

<!-- <fractal2d> -->
<implementation name="IM_fractal2d_float_genglsl" nodedef="ND_fractal2d_float" file="mx_fractal2d_float.glsl" function="mx_fractal2d_float" target="genglsl" />
<implementation name="IM_fractal2d_vector2_genglsl" nodedef="ND_fractal2d_vector2" file="mx_fractal2d_vector2.glsl" function="mx_fractal2d_vector2" target="genglsl" />
<implementation name="IM_fractal2d_vector3_genglsl" nodedef="ND_fractal2d_vector3" file="mx_fractal2d_vector3.glsl" function="mx_fractal2d_vector3" target="genglsl" />
<implementation name="IM_fractal2d_vector4_genglsl" nodedef="ND_fractal2d_vector4" file="mx_fractal2d_vector4.glsl" function="mx_fractal2d_vector4" target="genglsl" />

<!-- <fractal3d> -->
<implementation name="IM_fractal3d_float_genglsl" nodedef="ND_fractal3d_float" file="mx_fractal3d_float.glsl" function="mx_fractal3d_float" target="genglsl" />
<implementation name="IM_fractal3d_vector2_genglsl" nodedef="ND_fractal3d_vector2" file="mx_fractal3d_vector2.glsl" function="mx_fractal3d_vector2" target="genglsl" />
Expand Down
6 changes: 6 additions & 0 deletions libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
<implementation name="IM_noise3d_vector3_genmdl" nodedef="ND_noise3d_vector3" sourcecode="materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_noise3d_float3(mxp_amplitude:{{amplitude}}, mxp_pivot:{{pivot}}, mxp_position:{{position}})" target="genmdl" />
<implementation name="IM_noise3d_vector4_genmdl" nodedef="ND_noise3d_vector4" sourcecode="materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_noise3d_float4(mxp_amplitude:{{amplitude}}, mxp_pivot:{{pivot}}, mxp_position:{{position}})" target="genmdl" />

<!-- <fractal2d> -->
<implementation name="IM_fractal2d_float_genmdl" nodedef="ND_fractal2d_float" sourcecode="materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_fractal2d_float(mxp_amplitude:{{amplitude}}, mxp_octaves:{{octaves}}, mxp_lacunarity:{{lacunarity}}, mxp_diminish:{{diminish}}, mxp_texcoord:{{texcoord}})" target="genmdl" />
<implementation name="IM_fractal2d_vector2_genmdl" nodedef="ND_fractal2d_vector2" sourcecode="materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_fractal2d_float2(mxp_amplitude:{{amplitude}}, mxp_octaves:{{octaves}}, mxp_lacunarity:{{lacunarity}}, mxp_diminish:{{diminish}}, mxp_texcoord:{{texcoord}})" target="genmdl" />
<implementation name="IM_fractal2d_vector3_genmdl" nodedef="ND_fractal2d_vector3" sourcecode="materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_fractal2d_float3(mxp_amplitude:{{amplitude}}, mxp_octaves:{{octaves}}, mxp_lacunarity:{{lacunarity}}, mxp_diminish:{{diminish}}, mxp_texcoord:{{texcoord}})" target="genmdl" />
<implementation name="IM_fractal2d_vector4_genmdl" nodedef="ND_fractal2d_vector4" sourcecode="materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_fractal2d_float4(mxp_amplitude:{{amplitude}}, mxp_octaves:{{octaves}}, mxp_lacunarity:{{lacunarity}}, mxp_diminish:{{diminish}}, mxp_texcoord:{{texcoord}})" target="genmdl" />

<!-- <fractal3d> -->
<implementation name="IM_fractal3d_float_genmdl" nodedef="ND_fractal3d_float" sourcecode="materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_fractal3d_float(mxp_amplitude:{{amplitude}}, mxp_octaves:{{octaves}}, mxp_lacunarity:{{lacunarity}}, mxp_diminish:{{diminish}}, mxp_position:{{position}})" target="genmdl" />
<implementation name="IM_fractal3d_vector2_genmdl" nodedef="ND_fractal3d_vector2" sourcecode="materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_fractal3d_float2(mxp_amplitude:{{amplitude}}, mxp_octaves:{{octaves}}, mxp_lacunarity:{{lacunarity}}, mxp_diminish:{{diminish}}, mxp_position:{{position}})" target="genmdl" />
Expand Down
1 change: 1 addition & 0 deletions libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<!-- Math nodes -->
<!-- ======================================================================== -->


<!-- <transformpoint> -->
<implementation name="IM_transformpoint_vector3_genmsl" nodedef="ND_transformpoint_vector3" target="genmsl" />

Expand Down
51 changes: 51 additions & 0 deletions libraries/stdlib/genosl/include/mx_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,57 @@ vector4 mx_noise(string noisetype, point position)
return vector4 (cnoise[0], cnoise[1], cnoise[2], fnoise);
}

float mx_fbm(float x, float y, int octaves, float lacunarity, float diminish, string noisetype)
{
float out = 0;
float amp = 1.0;
float xx = x;
float yy = y;

for (int i = 0; i < octaves; i += 1) {
out += amp * noise(noisetype, xx, yy);
amp *= diminish;
xx *= lacunarity;
yy *= lacunarity;
}
return out;
}

color mx_fbm(float x, float y, int octaves, float lacunarity, float diminish, string noisetype)
{
color out = 0;
float amp = 1.0;
float xx = x;
float yy = y;

for (int i = 0; i < octaves; i += 1) {
out += amp * (color)noise(noisetype, xx, yy);
amp *= diminish;
xx *= lacunarity;
yy *= lacunarity;
}
return out;
}

vector2 mx_fbm(float x, float y, int octaves, float lacunarity, float diminish, string noisetype)
{
return vector2((float) mx_fbm(x, y, octaves, lacunarity, diminish, noisetype),
(float) mx_fbm(x+19, y+193, octaves, lacunarity, diminish, noisetype));
}

color4 mx_fbm(float x, float y, int octaves, float lacunarity, float diminish, string noisetype)
{
color c = (color) mx_fbm(x, y, octaves, lacunarity, diminish, noisetype);
float f = (float) mx_fbm(x+19, y+193, octaves, lacunarity, diminish, noisetype);
return color4 (c, f);
}

vector4 mx_fbm(float x, float y, int octaves, float lacunarity, float diminish, string noisetype)
{
color c = (color) mx_fbm(x, y, octaves, lacunarity, diminish, noisetype);
float f = (float) mx_fbm(x+19, y+193, octaves, lacunarity, diminish, noisetype);
return vector4 (c[0], c[1], c[2], f);
}

float mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype)
{
Expand Down
5 changes: 5 additions & 0 deletions libraries/stdlib/genosl/mx_fractal2d_float.osl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void mx_fractal2d_float(float amplitude, int octaves, float lacunarity, float diminish, vector2 texcoord, output float result)
{
float f = mx_fbm(texcoord.x, texcoord.y, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
5 changes: 5 additions & 0 deletions libraries/stdlib/genosl/mx_fractal2d_vector2.osl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void mx_fractal2d_vector2(vector2 amplitude, int octaves, float lacunarity, float diminish, vector2 texcoord, output vector2 result)
{
vector2 f = mx_fbm(texcoord.x, texcoord.y, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
Loading