Practice free →
Home › Per The Book of Shaders, a SDF-based circle shap…

Per The Book of Shaders, a SDF-based circle shape in a fragment shader at point uv (centred at 0.5) uses which expression?

Asin(uv.x * 6.28) over the screen
Bsmoothstep(r, r + ε, length(uv − 0.5))
Ctexture2D(tex, uv) once per pixel
Dgl_FragCoord.x / 1080.0 only
Answer & Solution
Correct answer: B. smoothstep(r, r + ε, length(uv − 0.5))
Book of Shaders Shapes Ch.: distance = length(uv - 0.5); smoothstep gives anti-aliased disc edge. Building block for arbitrary 2D shapes.
Solve this in the app — Practice practice & 24k+ MCQs →
Related questions