Skip to content

Commit

Permalink
Add float suffix for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm committed Jan 7, 2024
1 parent 5b7a2c2 commit d664bae
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion libraries/stdlib/genglsl/mx_normalmap.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N,
result = normalize(value);
}

void mx_normalmap(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result)
void mx_normalmap_float(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result)
{
mx_normalmap_vector2(value, map_space, vec2(normal_scale), N, T, result);
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</implementation>

<!-- <normalmap> -->
<implementation name="IM_normalmap_genglsl" nodedef="ND_normalmap" file="mx_normalmap.glsl" function="mx_normalmap" target="genglsl" />
<implementation name="IM_normalmap_genglsl" nodedef="ND_normalmap" file="mx_normalmap.glsl" function="mx_normalmap_float" target="genglsl" />
<implementation name="IM_normalmap_vector2_genglsl" nodedef="ND_normalmap_vector2" file="mx_normalmap.glsl" function="mx_normalmap_vector2" target="genglsl" />


Expand Down
3 changes: 2 additions & 1 deletion libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
<!-- <triplanarprojection> -->

<!-- <normalmap> -->
<implementation name="IM_normalmap_genmdl" nodedef="ND_normalmap" sourcecode="mx::stdlib::mx_normalmap(mxp_in:{{in}}, mxp_space:{{space}}, mxp_scale:{{scale}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}})" target="genmdl" />
<implementation name="IM_normalmap_genmdl" nodedef="ND_normalmap" sourcecode="mx::stdlib::mx_normalmap_float(mxp_in:{{in}}, mxp_space:{{space}}, mxp_scale:{{scale}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}})" target="genmdl" />
<implementation name="IM_normalmap_genmdl_vector2" nodedef="ND_normalmap_vector2" sourcecode="mx::stdlib::mx_normalmap_vector2(mxp_in:{{in}}, mxp_space:{{space}}, mxp_scale:{{scale}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}})" target="genmdl" />

<!-- ======================================================================== -->
<!-- Procedural nodes -->
<!-- ======================================================================== -->
Expand Down
2 changes: 1 addition & 1 deletion libraries/stdlib/genmsl/mx_normalmap.metal
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N,
result = normalize(value);
}

void mx_normalmap(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result)
void mx_normalmap_float(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result)
{
mx_normalmap_vector2(value, map_space, vec2(normal_scale), N, T, result);
}
2 changes: 1 addition & 1 deletion libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</implementation>

<!-- <normalmap> -->
<implementation name="IM_normalmap_genmsl" nodedef="ND_normalmap" file="mx_normalmap.metal" function="mx_normalmap" target="genmsl" />
<implementation name="IM_normalmap_genmsl" nodedef="ND_normalmap" file="mx_normalmap.metal" function="mx_normalmap_float" target="genmsl" />
<implementation name="IM_normalmap_vector2_genmsl" nodedef="ND_normalmap_vector2" file="mx_normalmap.metal" function="mx_normalmap_vector2" target="genmsl" />

<!-- ======================================================================== -->
Expand Down
2 changes: 1 addition & 1 deletion libraries/stdlib/genosl/mx_normalmap.osl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void mx_normalmap_vector2(vector value, string map_space, vector2 normal_scale,
}
}

void mx_normalmap(vector value, string map_space, float normal_scale, vector N, vector U, output vector result)
void mx_normalmap_float(vector value, string map_space, float normal_scale, vector N, vector U, output vector result)
{
mx_normalmap_vector2(value, map_space, vector2(normal_scale, normal_scale), N, U, result);
}
3 changes: 2 additions & 1 deletion libraries/stdlib/genosl/stdlib_genosl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
<!-- <triplanarprojection> -->

<!-- <normalmap> -->
<implementation name="IM_normalmap_genosl" nodedef="ND_normalmap" file="mx_normalmap.osl" function="mx_normalmap" target="genosl" />
<implementation name="IM_normalmap_genosl" nodedef="ND_normalmap" file="mx_normalmap.osl" function="mx_normalmap_float" target="genosl" />
<implementation name="IM_normalmap_vector2_genosl" nodedef="ND_normalmap_vector2" file="mx_normalmap.osl" function="mx_normalmap_vector2" target="genosl" />

<!-- ======================================================================== -->
<!-- Procedural nodes -->
<!-- ======================================================================== -->
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenMdl/mdl/materialx/stdlib.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -2087,7 +2087,7 @@ export float3 mx_normalmap_vector2(
}
}

export float3 mx_normalmap(
export float3 mx_normalmap_float(
float3 mxp_in = float3(0.5, 0.5, 1.0),
uniform string mxp_space = string("tangent")
[[
Expand Down

0 comments on commit d664bae

Please sign in to comment.