2
$\begingroup$

I want to start developing a hybrid renderer: it first applies a rasterizer, then stores for each pixel the surface pointer, normal vector, and distance to the camera.

Then it raytraces reflections, refractions, lambertian diffuse, etc using those values.

The first problem however is rasterizing a sphere: while there are many tutorials for rasterizing quads and triangles, there aren't any on spheres, and I don't know how to do this myself while keeping perspective intact.

So how do you perfectly rasterize an explicit sphere (with radius, center)?

$\endgroup$
1
  • $\begingroup$ You discretize it, then you render it. As far as I am aware there is no GL_SPHERE or anything of the sort. $\endgroup$ Commented Nov 7, 2019 at 23:58

1 Answer 1

2
$\begingroup$

Jim Blinn's book Jim Blinn's Corner: Notation, Notation, Notation has a couple of chapters which go through this in detail with all of the edge cases. This book is a collection of essays from his column in IEEE Computer Graphics and Applications. Highly recommended.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.