... so they can be used with shady.
Here are implementations for float (after the example here). Should be relatively easy to make them generic:
proc step*(a, x: float): float =
if x < a:
0.0
else:
1.0
proc smoothstep*(a, b, x: float): float =
# Scale, and clamp x to 0..1 range
let x = clamp((x - a) / (b - a), 0.0, 1.0)
x * x * (3.0 - 2.0 * x)
Then update shady to add these functions to glslFunctions.
... so they can be used with shady.
Here are implementations for
float(after the example here). Should be relatively easy to make them generic:Then update shady to add these functions to
glslFunctions.