Package renderer.pipeline
Class Rasterize_AntiAlias_Line
- java.lang.Object
-
- renderer.pipeline.Rasterize_AntiAlias_Line
-
public class Rasterize_AntiAlias_Line extends Object
Rasterize a clippedLineSegmentinto 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
LineSegmentwith 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 voidrasterize(Model model, LineSegment ls, FrameBuffer.Viewport vp)Rasterize a clippedLineSegmentinto anti-aliased, shaded pixels in theFrameBuffer.Viewport.
-
-
-
Method Detail
-
rasterize
public static void rasterize(Model model, LineSegment ls, FrameBuffer.Viewport vp)
Rasterize a clippedLineSegmentinto anti-aliased, shaded pixels in theFrameBuffer.Viewport.- Parameters:
model-Modelthat theLineSegmentlscomes fromls-LineSegmentto rasterize into theFrameBuffer.Viewportvp-FrameBuffer.Viewportto hold rasterized pixels
-
-