Skip to content

Commit

Permalink
Restore isotropic fallback for roughness_dual
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm committed Aug 3, 2019
1 parent 5ee03bb commit f60538f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/pbrlib/genglsl/mx_roughness_dual.glsl
Original file line number Diff line number Diff line change
@@ -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);
}
4 changes: 4 additions & 0 deletions libraries/pbrlib/genosl/mx_roughness_dual.osl
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit f60538f

Please sign in to comment.