Package renderer.pipeline
Class Rasterize_AntiAlias_Line
- java.lang.Object
-
- renderer.pipeline.Rasterize_AntiAlias_Line
-
public class Rasterize_AntiAlias_Line extends Object
Rasterize a clippedLineSegment
into shaded pixels in aFrameBuffer
's viewport and (optionally) anti-alias and gamma-encode the line at the same time.This pipeline stage takes a clipped
LineSegment
with vertices in theCamera
's view rectangle and rasterizezs the line segment into shaded, anti-aliased pixels in aFrameBuffer
's viewport. This rasterizer will linearly interpolate color from the line segment's two endpoints to each rasterized (and anti-aliased) pixel in the line segment.This rasterization algorithm is based on
"Fundamentals of Computer Graphics", 3rd Edition, by Peter Shirley, pages 163-165.
This rasterizer implements a simple version of Xiaolin_Wu's anti-aliasing algorithm. See https://en.wikipedia.org/wiki/Xiaolin_Wu's_line_algorithm
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
rasterize(Model model, LineSegment ls, FrameBuffer.Viewport vp)
Rasterize a clippedLineSegment
into anti-aliased, shaded pixels in theFrameBuffer.Viewport
.
-
-
-
Method Detail
-
rasterize
public static void rasterize(Model model, LineSegment ls, FrameBuffer.Viewport vp)
Rasterize a clippedLineSegment
into anti-aliased, shaded pixels in theFrameBuffer.Viewport
.- Parameters:
model
-Model
that theLineSegment
ls
comes fromls
-LineSegment
to rasterize into theFrameBuffer.Viewport
vp
-FrameBuffer.Viewport
to hold rasterized pixels
-
-