3 ms·
sdf stands for "signed distance function". It helps the magic of ShaderToy [0] to obtain real time rendering in the browser. Note how the animations on the Sha
by jhncls 6y ago
sdf stands for "signed distance function". It helps the magic of ShaderToy [0] to obtain real time rendering in the browser. Note how the animations on the ShaderToy website aren't videos but real-time renderings. See e.g. how straightforward the coneSdf is implemented [1].
[0] https://www.shadertoy.com/ https://www.shadertoy.com/
[1] https://www.shadertoy.com/view/4l3BW7 https://www.shadertoy.com/view/4l3BW7
float coneSDF( vec3 p, vec2 c )
{
float q = length(p.xz);
return dot(c,vec2(q,p.y));
}