GLSL functions
length(x)
– length of afloat
,vec2
,vec3
orvec4
distance(a, b)
– distance betweena..b
step(edge, x)
– return 0 ifx < edge
, otherwise 1smoothstep(edge0, edge1, x)
– likestep
but interpolatie betweenedge0
andedge1
.mix(x, y, a)
- interpolate betweenx..y
witha = 0 .. 1
min(x, y)
– return the lesser valuemax(x, y)
– return the greater valueclamp(x, a, b)
– clamp the value between[a .. b]
- Trigonometric functions, eg.
sin(x)
,cos(x)
,atan(x)