You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be helpful to add a note after the definition about how GLSL actually implements smoothstep in a way that reverse the output to [1, 0] when the left side is greater than the right side. I looked at the code and tried to understand how it actually worked but apparently not complying with what the definition said.
The GLSL spec does say "Results are undefined if edge0 >= edge1."
The lesson learned in this section is the specs do not define what is actually implemented. It took me a bit for that to sink in.
https://thebookofshaders.com/glossary/?search=smoothstep says "Results are undefined if edge0 ≥ edge1".
At the same time, https://thebookofshaders.com/05/ uses
smoothstep(0.02, 0.0, ...)
.NVidia reference says:
which actually explains why and how the code works.
The text was updated successfully, but these errors were encountered: