Skip to content

Commit 81e3e24

Browse files
authored
Align smoothstep edge cases with OSL (#1985)
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.
1 parent 29dc40a commit 81e3e24

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
void mx_smoothstep_float(float val, float low, float high, out float result)
22
{
3-
if (val <= low)
4-
result = 0.0;
5-
else if (val >= high)
3+
if (val >= high)
64
result = 1.0;
5+
else if (val <= low)
6+
result = 0.0;
77
else
88
result = smoothstep(low, high, val);
99
}

0 commit comments

Comments
 (0)