3
$\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$
  • $\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$ – lightxbulb Nov 7 at 23:58
3
$\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$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.