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

Simplify OSL support library #1184

Merged
merged 1 commit into from
Jan 1, 2023
Merged
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
626 changes: 94 additions & 532 deletions libraries/stdlib/genosl/include/mx_funcs.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_fractal3d_color3.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_fractal3d_color3(vector amplitude, int octaves, float lacunarity, float diminish, vector position, output color result)
{
color f = fBm(position, octaves, lacunarity, diminish, "snoise");
color f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
4 changes: 2 additions & 2 deletions libraries/stdlib/genosl/mx_fractal3d_color4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_fractal3d_color4(vector4 amplitude, int octaves, float lacunarity, float diminish, vector position, output color4 result)
{
color4 f = fBm(position, octaves, lacunarity, diminish, "snoise");
result = f * combine(amplitude.x, amplitude.y, amplitude.z, amplitude.w);
color4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
result = f * mx_combine(amplitude.x, amplitude.y, amplitude.z, amplitude.w);
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_fractal3d_fa_color3.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_fractal3d_fa_color3(float amplitude, int octaves, float lacunarity, float diminish, vector position, output color result)
{
color f = fBm(position, octaves, lacunarity, diminish, "snoise");
color f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_fractal3d_fa_color4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_fractal3d_fa_color4(float amplitude, int octaves, float lacunarity, float diminish, vector position, output color4 result)
{
color4 f = fBm(position, octaves, lacunarity, diminish, "snoise");
color4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_fractal3d_fa_vector2.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_fractal3d_fa_vector2(float amplitude, int octaves, float lacunarity, float diminish, vector position, output vector2 result)
{
vector2 f = fBm(position, octaves, lacunarity, diminish, "snoise");
vector2 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_fractal3d_fa_vector3.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_fractal3d_fa_vector3(float amplitude, int octaves, float lacunarity, float diminish, vector position, output vector result)
{
vector f = fBm(position, octaves, lacunarity, diminish, "snoise");
vector f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_fractal3d_fa_vector4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_fractal3d_fa_vector4(float amplitude, int octaves, float lacunarity, float diminish, vector position, output vector4 result)
{
vector4 f = fBm(position, octaves, lacunarity, diminish, "snoise");
vector4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_fractal3d_float.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vector position, output float result)
{
float f = fBm(position, octaves, lacunarity, diminish, "snoise");
float f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_fractal3d_vector2.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_fractal3d_vector2(vector2 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector2 result)
{
vector2 f = fBm(position, octaves, lacunarity, diminish, "snoise");
vector2 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_fractal3d_vector3.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_fractal3d_vector3(vector amplitude, int octaves, float lacunarity, float diminish, vector position, output vector result)
{
vector f = fBm(position, octaves, lacunarity, diminish, "snoise");
vector f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_fractal3d_vector4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_fractal3d_vector4(vector4 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector4 result)
{
vector4 f = fBm(position, octaves, lacunarity, diminish, "snoise");
vector4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
result = f * amplitude;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_noise2d_color4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise2d_color4(vector4 amplitude, float pivot, vector2 texcoord, output color4 result)
{
color4 value = noise("snoise", texcoord.x, texcoord.y);
color4 value = mx_noise("snoise", texcoord.x, texcoord.y);
result = value * color4(color(amplitude.x, amplitude.y, amplitude.z), amplitude.w) + pivot;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_noise2d_fa_color4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise2d_fa_color4(float amplitude, float pivot, vector2 texcoord, output color4 result)
{
color4 value = noise("snoise", texcoord.x, texcoord.y);
color4 value = mx_noise("snoise", texcoord.x, texcoord.y);
result = value * amplitude + pivot;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_noise2d_fa_vector2.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise2d_fa_vector2(float amplitude, float pivot, vector2 texcoord, output vector2 result)
{
vector2 value = noise("snoise", texcoord.x, texcoord.y);
vector2 value = mx_noise("snoise", texcoord.x, texcoord.y);
result = value * amplitude + pivot;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_noise2d_fa_vector4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise2d_fa_vector4(float amplitude, float pivot, vector2 texcoord, output vector4 result)
{
vector4 value = noise("snoise", texcoord.x, texcoord.y);
vector4 value = mx_noise("snoise", texcoord.x, texcoord.y);
result = value * amplitude + pivot;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_noise2d_vector2.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise2d_vector2(vector2 amplitude, float pivot, vector2 texcoord, output vector2 result)
{
vector2 value = noise("snoise", texcoord.x, texcoord.y);
vector2 value = mx_noise("snoise", texcoord.x, texcoord.y);
result = value * amplitude + pivot;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_noise2d_vector4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise2d_vector4(vector4 amplitude, float pivot, vector2 texcoord, output vector4 result)
{
vector4 value = noise("snoise", texcoord.x, texcoord.y);
vector4 value = mx_noise("snoise", texcoord.x, texcoord.y);
result = value * amplitude + pivot;
}
4 changes: 2 additions & 2 deletions libraries/stdlib/genosl/mx_noise3d_color4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise3d_color4(vector4 amplitude, float pivot, vector position, output color4 result)
{
color4 value = noise("snoise", position);
result = value * combine(amplitude.x, amplitude.y, amplitude.z, amplitude.w) + pivot;
color4 value = mx_noise("snoise", position);
result = value * mx_combine(amplitude.x, amplitude.y, amplitude.z, amplitude.w) + pivot;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_noise3d_fa_color4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise3d_fa_color4(float amplitude, float pivot, vector position, output color4 result)
{
color4 value = noise("snoise", position);
color4 value = mx_noise("snoise", position);
result = value * amplitude + pivot;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_noise3d_fa_vector2.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise3d_fa_vector2(float amplitude, float pivot, vector position, output vector2 result)
{
vector2 value = noise("snoise", position);
vector2 value = mx_noise("snoise", position);
result = value * amplitude + pivot;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_noise3d_fa_vector4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise3d_fa_vector4(float amplitude, float pivot, vector position, output vector4 result)
{
vector4 value = noise("snoise", position);
vector4 value = mx_noise("snoise", position);
result = value * amplitude + pivot;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_noise3d_vector2.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise3d_vector2(vector2 amplitude, float pivot, vector position, output vector2 result)
{
vector2 value = noise("snoise", position);
vector2 value = mx_noise("snoise", position);
result = value * amplitude + pivot;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_noise3d_vector4.osl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void mx_noise3d_vector4(vector4 amplitude, float pivot, vector position, output vector4 result)
{
vector4 value = noise("snoise", position);
vector4 value = mx_noise("snoise", position);
result = value * amplitude + pivot;
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_remap.inline
Original file line number Diff line number Diff line change
@@ -1 +1 @@
remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)
mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)