diff --git a/libraries/pbrlib/genglsl/mx_roughness_dual.glsl b/libraries/pbrlib/genglsl/mx_roughness_dual.glsl index a3d1f4413e..f4b538399e 100644 --- a/libraries/pbrlib/genglsl/mx_roughness_dual.glsl +++ b/libraries/pbrlib/genglsl/mx_roughness_dual.glsl @@ -1,5 +1,9 @@ void mx_roughness_dual(vec2 roughness, out vec2 result) { + if (roughness.y < 0.0) + { + roughness.y = roughness.x; + } result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); } diff --git a/libraries/pbrlib/genosl/mx_roughness_dual.osl b/libraries/pbrlib/genosl/mx_roughness_dual.osl index 42d04cd909..ea683def05 100644 --- a/libraries/pbrlib/genosl/mx_roughness_dual.osl +++ b/libraries/pbrlib/genosl/mx_roughness_dual.osl @@ -1,5 +1,9 @@ void mx_roughness_dual(vector2 roughness, output vector2 result) { + if (roughness.y < 0.0) + { + roughness.y = roughness.x; + } result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); }