News for hackers. Stuff that matters.
Re:Painting a Selfie Girl, with Maths [video] by jansan on Monday November 30, 2020 @06:29AM (#25252733)
This is a great video. Not only is it really interesting, but the sound, the transitions, his voice, everything is just perfect.

What I do not really understand: Are all these functions (for example sdfCone()) generic modelling terminology or are they specific to a certain tool?

Re:Painting a Selfie Girl, with Maths [video] by Netcob on Monday November 30, 2020 @08:16AM (#25253379)
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/distfu...

Re:Painting a Selfie Girl, with Maths [video] by jhncls on Monday November 30, 2020 @06:50AM (#25252844)
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/

[1] https://www.shadertoy.com/view/4l3BW7

    float coneSDF( vec3 p, vec2 c )
    {
        float q = length(p.xz);
        return dot(c,vec2(q,p.y));
    }
Re:Painting a Selfie Girl, with Maths [video] by swiftcoder on Monday November 30, 2020 @06:54AM (#25252875)
They are fairly generic within the family of tools based on signed distance fields - which is mostly graphics programmers writing code in Shadertoy, but also underlies things like Dreams on PS4