diff --git a/libraries/stdlib/genglsl/mx_normalmap.glsl b/libraries/stdlib/genglsl/mx_normalmap.glsl
index 86d5610fea..19e0797c4f 100644
--- a/libraries/stdlib/genglsl/mx_normalmap.glsl
+++ b/libraries/stdlib/genglsl/mx_normalmap.glsl
@@ -1,4 +1,4 @@
-void mx_normalmap(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result)
+void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N, vec3 T, out vec3 result)
{
// Decode the normal map.
value = (value == vec3(0.0f)) ? vec3(0.0, 0.0, 1.0) : value * 2.0 - 1.0;
@@ -14,3 +14,8 @@ void mx_normalmap(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T,
// Normalize the result.
result = normalize(value);
}
+
+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);
+}
diff --git a/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx b/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx
index 6f67b21d33..dc4f52e3b6 100644
--- a/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx
+++ b/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx
@@ -42,7 +42,9 @@
-
+
+
+
diff --git a/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx b/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx
index 6c550c92db..96fd768e25 100644
--- a/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx
+++ b/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx
@@ -44,7 +44,8 @@
-
+
+
diff --git a/libraries/stdlib/genmsl/mx_normalmap.metal b/libraries/stdlib/genmsl/mx_normalmap.metal
index c9c7bd5546..a3ffedaad5 100644
--- a/libraries/stdlib/genmsl/mx_normalmap.metal
+++ b/libraries/stdlib/genmsl/mx_normalmap.metal
@@ -1,4 +1,4 @@
-void mx_normalmap(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result)
+void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N, vec3 T, out vec3 result)
{
// Decode the normal map.
value = all(value == vec3(0.0f)) ? vec3(0.0, 0.0, 1.0) : value * 2.0 - 1.0;
@@ -14,3 +14,8 @@ void mx_normalmap(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T,
// Normalize the result.
result = normalize(value);
}
+
+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);
+}
diff --git a/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx b/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx
index 40be6f8c46..1875c2b617 100644
--- a/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx
+++ b/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx
@@ -42,7 +42,8 @@
-
+
+
diff --git a/libraries/stdlib/genosl/mx_normalmap.osl b/libraries/stdlib/genosl/mx_normalmap.osl
index a1f276faf1..bf75781f51 100644
--- a/libraries/stdlib/genosl/mx_normalmap.osl
+++ b/libraries/stdlib/genosl/mx_normalmap.osl
@@ -1,4 +1,4 @@
-void mx_normalmap(vector value, string map_space, float normal_scale, vector N, vector U, output vector result)
+void mx_normalmap_vector2(vector value, string map_space, vector2 normal_scale, vector N, vector U, output vector result)
{
// Tangent space
if (map_space == "tangent")
@@ -6,7 +6,7 @@ void mx_normalmap(vector value, string map_space, float normal_scale, vector N,
vector v = value * 2.0 - 1.0;
vector T = normalize(U - dot(U, N) * N);
vector B = normalize(cross(N, T));
- result = normalize(T * v[0] * normal_scale + B * v[1] * normal_scale + N * v[2]);
+ result = normalize(T * v[0] * normal_scale[0] + B * v[1] * normal_scale[1] + N * v[2]);
}
// Object space
else
@@ -15,3 +15,8 @@ void mx_normalmap(vector value, string map_space, float normal_scale, vector N,
result = normalize(n);
}
}
+
+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);
+}
diff --git a/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx b/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx
index a984d912b8..ae3f6777cf 100644
--- a/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx
+++ b/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx
@@ -44,7 +44,8 @@
-
+
+
diff --git a/libraries/stdlib/stdlib_defs.mtlx b/libraries/stdlib/stdlib_defs.mtlx
index 90ccb57a98..051891cf83 100644
--- a/libraries/stdlib/stdlib_defs.mtlx
+++ b/libraries/stdlib/stdlib_defs.mtlx
@@ -2505,6 +2505,14 @@
+
+
+
+
+
+
+
+