4 ms·
Adding to the other explanations: I think the way you go about it is to simply google some SDF implementations of primitives (looking for them on shadertoy will
by Netcob 6y ago
Adding to the other explanations: I think the way you go about it is to simply google some SDF implementations of primitives (looking for them on shadertoy will already give you a basic set pretty quickly), and you can expect that implementation to take an arbitrary position in space, some parameters describing the primitive, and it will return the distance to the surface from that point - negative if the point is inside the primitive.
Then all you need is some function that does raymarching and a bunch of other tricks to do shading. It's all part of graphics processing, so there is definitely some common terminology there.
For some SDFs you could start with IQ's page: https://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm https://www.iquilezles.org/www/articles/distfunctions/distfu...