<p>Jim Blinn's book <em>Jim Blinn's Corner: Notation, Notation, Notation</em> 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 <em>IEEE Computer Graphics and Applications</em>. Highly recommended.</p>

CC BY-SA 4.0
2019-11-08T22:07:34.623Z
2019-11-08T22:07:34.623Z
MPG
<p>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.</p>

<p>Then it raytraces reflections, refractions, lambertian diffuse, etc using those values.</p>

<p>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.</p>

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

CC BY-SA 4.0
2019-11-07T23:58:01.217Z
You discretize it, then you render it. As far as I am aware there is no `GL_SPHERE` or anything of the sort.
lightxbulb
<perspective><rasterizer>
Rasterizing spheres?
AnnoyinC
# Rasterizing spheres?

(Asked by: username_0 on 2019-11-07)

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)?

**Tags:** perspective, rasterizer

> **Comments:**
> **username_1**: You discretize it, then you render it. As far as I am aware there is no `GL_SPHERE` or anything of the sort.  

---

## 1 answers

### Answer by username_2 on 2019-11-08. Score: 2

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.


---

