Expand description
Translation of vector shapes into discrete pixels in the framebuffer.
Rasterization proceeds by turning a primitive such as a triagle into a sequence of scanlines, each corresponding to a horizontal span of pixels covered by the primitive on a given line. The scanlines, in turn, are converted into a series of fragments that represent potentially drawn pixels.
If depth testing (z-buffering) is enabled, the fragments are then tested against the current depth value in their position. For each fragment that passes the depth test, a color is computed by the fragment shader and written into the framebuffer. Fragments that fail the test are discarded.
Structs§
- Frag
- A fragment, or a single “pixel” in a rasterized primitive.
- Scanline
- A horizontal, 1-pixel-thick “slice” of a primitive being rasterized.
- Scanline
Iter - Iterator emitting scanlines, linearly interpolating values between the left and right endpoints as it goes.
Functions§
- line
- Rasterizes a one-pixel-thick line between two vertices.
- scan
- Returns an iterator that emits a scanline for each line from
y0toy1, interpolating varyings froml0tol1on the left and fromr0tor1on the right side. - tri_
fill - Rasterizes a filled triangle defined by three vertices.