Skip to content

Commit

Permalink
Align smoothstep edge cases with OSL (#1985)
Browse files Browse the repository at this point in the history
Following a conversation on ASWF slack this PR was posted to OSL refining the edge cases for `smoothstep()`.

AcademySoftwareFoundation/OpenShadingLanguage#1851

This PR aligns the GLSL/MSL code with this change.
  • Loading branch information
ld-kerley committed Sep 5, 2024
1 parent 29dc40a commit 81e3e24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/stdlib/genglsl/mx_smoothstep_float.glsl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
void mx_smoothstep_float(float val, float low, float high, out float result)
{
if (val <= low)
result = 0.0;
else if (val >= high)
if (val >= high)
result = 1.0;
else if (val <= low)
result = 0.0;
else
result = smoothstep(low, high, val);
}

0 comments on commit 81e3e24

Please sign in to comment.