<p>Polygon rasterization (the conversion of the analog polygon data into a <a href="https://en.wikipedia.org/wiki/Raster_graphics" rel="nofollow noreferrer">raster image</a>) is a key operation in rasterization-based rendering. As such, performing this operation fast, and with predictable performance, is key to the performance of graphics rendering.</p>

<p>It is possible to rasterize any arbitrary polygon. But rasterizing triangles is extremely simple to code and offers numerous efficiency improvements over general polygon rasterization.</p>

<p>Triangle rasterization is done by something called "scan conversion": you break the triangle up into a series of horizontal scan-lines (one pixel tall) of a length determined by the sides of the triangle. Building these scan-lines and getting their lengths is something you can do through basic integer math involving only additions and multiplications. Furthermore, each scan-line can be constructed <em>independently</em> of the others, so highly threaded hardware can be employed to perform this process efficiently.</p>

<p>None of this is true for arbitrary polygons. Concave polygons in particular require much more complex math. A concave polygon can have multiple lines in the same horizontal row.</p>

<p>Furthermore, interpolation of values across the surface of a triangle can be done by relatively simple math. For each scanline, you can compute a gradient that represents how much each value changes from one end of the line to the other. So given a starting value at one line, you can easily compute the interpolated position at any point on the scanline simply by multiplication and addition. If you're computing them in sequence, you don't even need the multiplication; successive addition is adequate.</p>

<p>Interpolation of values across an arbitrary polygonal surface is much more complicated.</p>

<p>Given all of these advantages, and the fact that you can use a series of triangles to build any arbitrary polygon, there's really no reason to rasterize any more complex shape.</p>

CC BY-SA 4.0
2018-12-05T22:38:06.497Z
BTW, GPU hardware does not really use scan-conversion; it uses tile-based rasterization instead. But the main point that the math is simple still holds: sample coverage is determined by checking the three edge inequalities, and attribute interpolation is evaluating a plane equation.
Nathan Reed
CC BY-SA 4.0
2018-12-03T16:53:31.577Z
2018-12-05T19:00:08.230Z
2018-12-05T19:00:08.230Z
Nicol Bolas
<p>I'm new to computer graphics and just wanted a solid understanding of why?</p>

<p>Why is it so important that polygons you push through the pipeline be "<strong>simple</strong>" and "<strong>convex</strong>"? </p>

<polygon>
Why do polygons have to be "simple" and "convex"?
user9778
# Why do polygons have to be "simple" and "convex"?

(Asked by: username_0 on 2018-12-01)

I'm new to computer graphics and just wanted a solid understanding of why?

Why is it so important that polygons you push through the pipeline be "**simple**" and "**convex**"?

**Tags:** polygon


---

## 1 answers

### Answer by username_1 on 2018-12-03. Score: 5

Polygon rasterization (the conversion of the analog polygon data into a [raster image](https://en.wikipedia.org/wiki/Raster_graphics)) is a key operation in rasterization-based rendering. As such, performing this operation fast, and with predictable performance, is key to the performance of graphics rendering.

It is possible to rasterize any arbitrary polygon. But rasterizing triangles is extremely simple to code and offers numerous efficiency improvements over general polygon rasterization.

Triangle rasterization is done by something called "scan conversion": you break the triangle up into a series of horizontal scan-lines (one pixel tall) of a length determined by the sides of the triangle. Building these scan-lines and getting their lengths is something you can do through basic integer math involving only additions and multiplications. Furthermore, each scan-line can be constructed *independently* of the others, so highly threaded hardware can be employed to perform this process efficiently.

None of this is true for arbitrary polygons. Concave polygons in particular require much more complex math. A concave polygon can have multiple lines in the same horizontal row.

Furthermore, interpolation of values across the surface of a triangle can be done by relatively simple math. For each scanline, you can compute a gradient that represents how much each value changes from one end of the line to the other. So given a starting value at one line, you can easily compute the interpolated position at any point on the scanline simply by multiplication and addition. If you're computing them in sequence, you don't even need the multiplication; successive addition is adequate.

Interpolation of values across an arbitrary polygonal surface is much more complicated.

Given all of these advantages, and the fact that you can use a series of triangles to build any arbitrary polygon, there's really no reason to rasterize any more complex shape.

> **Comments:**
> **username_2**: BTW, GPU hardware does not really use scan-conversion; it uses tile-based rasterization instead. But the main point that the math is simple still holds: sample coverage is determined by checking the three edge inequalities, and attribute interpolation is evaluating a plane equation.  

---

