4. Rasterization, Clipping, and VisibilityIntroduction and ContextA geometric description of a scene is continuous: a line contains infinitely many points, a circle has an ideal boundary, and a triangle occupies a precisely defined region of the plane. A display device, however, is discrete. It consists of a finite array of pixels, each of which records a color or other attributes over a small area. The process of converting geometric descriptions into a pattern of pixels is called rasterization or scan conversion. Rasterization is not merely a drawing operation. It is the stage at which mathematical geometry becomes sampled visual data. Decisions made during rasterization determine whether lines appear connected, whether circles look symmetrical, whether triangle edges produce cracks, and whether interpolated colors and depths remain consistent. Before rasterization, clipping removes portions of primitives that cannot contribute to the image. After or during rasterization, visibility algorithms determine which fragments are allowed to affect the final framebuffer. This chapter develops the principal algorithms and design decisions associated with these operations. It begins with line, circle, polygon, and triangle rasterization, then examines clipping, interpolation, antialiasing, depth buffering, culling, and hidden-surface removal. The discussion is relevant both to classical software renderers and to modern graphics pipelines implemented through programmable GPUs. Learning ObjectivesAfter completing this chapter, a student should be able to: 1. Explain the difference between continuous geometric primitives and discrete raster images. 2. Derive and implement the DDA and Bresenham line algorithms. 3. Describe midpoint circle rasterization and exploit symmetry. 4. Explain polygon and triangle scan conversion using edge functions and scanlines. 5. Apply Cohen–Sutherland, Liang–Barsky, and Sutherland–Hodgman clipping methods. 6. Interpolate attributes across a triangle and distinguish affine from perspective-correct interpolation. 7. Explain antialiasing techniques and their quality-performance trade-offs. 8. Use back-face culling and depth buffering to solve common visibility problems. 9. Compare hidden-surface-removal methods and select an appropriate approach for a rendering system. 10. Identify numerical, geometric, and architectural errors in rasterization pipelines. From Geometry to FragmentsA raster image is commonly represented as a two-dimensional array indexed by integer coordinates. A pixel is not just a mathematical point; ideally, it represents an area, such as the square region bounded by \(x\) and \(x+1\), and \(y\) and \(y+1\). A rasterizer must therefore decide how a primitive covers pixel areas. The simplest approach tests the pixel center. More accurate approaches evaluate coverage over the entire pixel or use multiple samples. The output of primitive rasterization is often called a fragment, not immediately a pixel. A fragment contains a candidate color, depth, and interpolated attributes such as texture coordinates or normals. Fragment operations may discard it, compare its depth with the stored depth, blend it with existing color, or write it to the framebuffer. Thus, rasterization and visibility are related but distinct: rasterization generates candidates, while visibility determines their contribution. Important terminology includes the following: - Primitive: A drawable geometric unit such as a point, line, triangle, or polygon.
- Sample: A location at which coverage or shading is evaluated.
- Fragment: A rasterized candidate associated with a pixel sample.
- Coverage: The fraction or logical status of a pixel covered by a primitive.
- Scan conversion: Conversion of geometric primitives into raster samples.
- Viewport: The region of the framebuffer into which normalized device coordinates are mapped.
- Clipping: Removal or modification of portions outside a specified region.
- Visibility: The determination of which surface is seen at a sample location.
Line RasterizationDigital Differential AnalyzerFor a line segment from \((x_0,y_0)\) to \((x_1,y_1)\), define \[ \Delta x=x_1-x_0,\qquad \Delta y=y_1-y_0. \] The Digital Differential Analyzer (DDA) chooses the number of steps according to the dominant direction: \[ steps=\max(|\Delta x|,|\Delta y|). \] The increments are \[ x_{inc}=\frac{\Delta x}{steps},\qquad y_{inc}=\frac{\Delta y}{steps}. \] Starting at \((x_0,y_0)\), the algorithm repeatedly adds these increments and rounds the resulting coordinates to select pixels. DDA is easy to understand and works for all slopes, but it uses floating-point addition and rounding. Repeated floating-point error can accumulate, and performance may be inferior to integer methods on systems where integer arithmetic is cheaper. Bresenham’s AlgorithmBresenham’s line algorithm selects the pixel whose center is closest to the ideal line while using incremental integer arithmetic. Consider first a line with slope between 0 and 1, moving from left to right. At each step, the next pixel is either directly to the right, called E, or diagonally up and right, called NE. An error or decision variable measures which candidate is closer to the ideal line. A common formulation uses \[ d=2\Delta y-\Delta x. \] If \(d<0\), choose E and update \(d\leftarrow d+2\Delta y\). Otherwise choose NE and update \(d\leftarrow d+2\Delta y-2\Delta x\). General implementations handle all octants by reflecting or by using signed increments. The crucial insight is that the algorithm evaluates the implicit line equation incrementally rather than calculating a new slope at every pixel. Bresenham’s method is deterministic, fast, and uses no floating-point arithmetic in its classical form. Its output is nevertheless a discrete approximation. It does not by itself provide antialiasing; it chooses one pixel per column or row. Line Quality and Practical IssuesA line rasterizer must establish endpoint conventions. If adjacent line segments share an endpoint, including both endpoints for both segments may cause a pixel to be drawn twice. With opaque primitives this may be harmless, but with blending or counting operations it creates visible or numerical artifacts. Graphics APIs therefore define rules such as the top-left convention to ensure consistent ownership of boundary samples. Thick lines require a different interpretation. They may be represented by a rectangle or a stroked path, and their joins and caps—miter, bevel, round, butt, or square—must be defined. For modern three-dimensional rendering, triangles are generally preferred to hardware line primitives because their coverage and interpolation rules are more consistent across implementations. Circle RasterizationThe implicit equation of a circle centered at \((x_c,y_c)\) with radius \(r\) is \[ f(x,y)=(x-x_c)^2+(y-y_c)^2-r^2=0. \] The midpoint circle algorithm evaluates this function at points midway between candidate pixels. In the first octant, the algorithm begins at \((0,r)\) and moves generally in the positive x direction while deciding whether the next point should remain at the same y or decrease y by one. Because a circle is symmetric under reflection about its horizontal and vertical axes and diagonals, a point \((x,y)\) generates up to eight pixels: \[ (\pm x,\pm y),\qquad (\pm y,\pm x). \] This symmetry reduces computation and ensures a balanced appearance. As with line rasterization, the midpoint method approximates an ideal boundary and can appear jagged at small sizes. Filling a circle requires a different operation: after generating the boundary, horizontal spans can be drawn between symmetric boundary points, or the circle can be treated as a special case of polygon or analytic coverage rasterization. Polygon and Triangle Scan ConversionWhy Triangles Dominate RenderingA general polygon may be concave, self-intersecting, or contain holes. Triangles are simpler: every triangle is planar, convex, and has a well-defined interior. Any sufficiently well-formed polygon can be tessellated into triangles. Consequently, most real-time rendering pipelines reduce surfaces to triangles before rasterization. Edge FunctionsFor an oriented edge from \(v_i=(x_i,y_i)\) to \(v_j=(x_j,y_j)\), define the edge function \[ E_{ij}(x,y)=(x-x_i)(y_j-y_i)-(y-y_i)(x_j-x_i). \] For a consistently counterclockwise triangle, a point lies inside or on the boundary when the three edge-function values have the same appropriate sign. Edge functions are affine in x and y, so moving one pixel horizontally or vertically changes their values by constant increments. This makes them well suited to incremental rasterization. The triangle area is proportional to the edge function evaluated at the third vertex. Normalized edge values provide barycentric coordinates: \[ \alpha=\frac{E_{23}(p)}{E_{23}(v_1)},\quad \beta=\frac{E_{31}(p)}{E_{31}(v_2)},\quad \gamma=\frac{E_{12}(p)}{E_{12}(v_3)}, \] with \(\alpha+\beta+\gamma=1\). If a point is inside the triangle, these coordinates are non-negative. Any vertex attribute \(a\\) can then be interpolated affinely as \[ a(p)=\alpha a_1+\beta a_2+\gamma a_3. \] Scanline ConversionA scanline algorithm processes one horizontal row at a time. It finds intersections between the scanline and polygon edges, sorts the intersection x-coordinates, and fills intervals between pairs of intersections. For a triangle, the edges can be represented with incremental inverse slopes, allowing intersection positions to be updated from one scanline to the next. The method must define how vertices are counted. If a scanline passes through a vertex shared by two edges, counting both edges can create an extra intersection; counting neither can create a gap. A common rule includes an edge at its lower endpoint but excludes its upper endpoint, or uses a top-left ownership convention. Such rules are not minor implementation details: inconsistent boundary treatment produces cracks between neighboring triangles. Polygon Filling RulesTwo common rules are the even–odd rule and the non-zero winding rule. Under the even–odd rule, a point is inside if a ray from it crosses the boundary an odd number of times. Under the winding rule, directed edge crossings are accumulated; a non-zero result indicates interior membership. The winding rule is useful for paths whose orientation encodes holes or nested regions. For concave polygons, direct triangulation or robust scan conversion is required. Self-intersecting polygons need an explicit fill rule. Degenerate polygons—those with zero area or coincident vertices—should usually be rejected or handled separately. Clipping: Reducing the Work and Defining the ViewClipping is performed against a region called the clip volume or clipping window. In a two-dimensional system this may be a rectangle; in a three-dimensional perspective pipeline it is commonly a canonical view volume bounded by planes. Clipping differs from culling. Clipping modifies a primitive that crosses the boundary, whereas culling rejects a primitive entirely when it cannot contribute. Clipping before rasterization improves efficiency and prevents invalid interpolation. In homogeneous three-dimensional coordinates, clipping is performed against inequalities such as \(-w\le x\le w\), \(-w\le y\le w\), and \(-w\le z\le w\). A vertex with a negative or unsuitable w-coordinate cannot simply be divided by w before clipping; doing so may produce incorrect geometry. Cohen–Sutherland Line ClippingCohen–Sutherland assigns each endpoint of a line an outcode describing whether it lies left, right, above, below, or beyond a clipping rectangle. If the bitwise OR of the endpoint codes is zero, the line is trivially accepted. If their bitwise AND is nonzero, the line is trivially rejected because both endpoints lie outside the same boundary. Otherwise, the line intersects the window and an endpoint is replaced by its intersection with an appropriate boundary. The test repeats until acceptance or rejection. The method is simple and effective when many segments are trivially accepted or rejected. Its repeated intersection calculations can be less efficient for lines that cross the window in complex ways. Liang–Barsky ClippingLiang–Barsky expresses the line parametrically: \[ p(t)=p_0+t(p_1-p_0),\qquad 0\le t\le1. \] Each window boundary produces an inequality restricting t. The intersection of these restrictions gives the visible interval \([t_{enter},t_{exit}]\). Because it calculates the parameter interval directly, Liang–Barsky generally requires fewer intersections than Cohen–Sutherland and is mathematically elegant. It also extends naturally to other convex clipping regions represented by half-spaces. Sutherland–Hodgman Polygon ClippingSutherland–Hodgman clips a polygon against one boundary at a time. For every edge from a previous vertex to a current vertex, it applies four cases: both outside, both inside, entering the boundary, or leaving the boundary. It emits the appropriate current vertex and/or intersection point. After processing all boundaries, the resulting vertex list represents the clipped polygon. The algorithm works particularly well for convex clipping windows. A polygon may gain vertices during clipping, and the output may be empty. For arbitrary subject polygons and complex clipping regions, algorithms such as Weiler–Atherton or modern polygon-clipping libraries may be more suitable. Interpolation Across a TriangleRasterization is also an attribute-generation process. Vertex colors, texture coordinates, normals, tangents, depths, and custom shader inputs must be assigned to every covered sample. Affine InterpolationIn screen space, barycentric interpolation gives an affine combination of vertex attributes. This is correct for attributes whose desired variation is linear in screen coordinates. It is commonly suitable for colors in simple two-dimensional drawing and for some quantities after appropriate transformation. Perspective-Correct InterpolationDirect interpolation of texture coordinates after perspective projection causes distortion. The reason is that perspective projection is not affine: objects farther from the camera are compressed. For an attribute a and clip-space coordinate w, the rasterizer interpolates \[ \frac{a}{w}\quad\text{and}\quad\frac{1}{w} \] affinely, then reconstructs \[ a(p)=\frac{\sum_i \lambda_i(a_i/w_i)}{\sum_i \lambda_i(1/w_i)}. \] This is perspective-correct interpolation. Texture mapping, depth-related quantities, and many shader inputs require this treatment. Failure to use it produces the familiar effect of textures appearing to slide or stretch incorrectly across polygons. Depth InterpolationDepth values are interpolated and compared at fragment locations. The exact representation depends on the projection and depth-buffer convention. In a perspective projection, depth is not linearly related to physical distance from the camera. This explains why much of the precision of a conventional depth buffer is concentrated near the near clipping plane. Antialiasing and Sampling QualityAliasing occurs when a continuous signal contains detail above the sampling capacity of the pixel grid. In graphics, it appears as stair-stepped edges, shimmering thin lines, moiré patterns, and temporal flicker. A binary pixel-center test is fast but produces hard, aliased boundaries. Antialiasing estimates the fraction of a pixel covered by a primitive or averages multiple samples. Supersampling renders at a higher resolution and downsamples; it improves quality but increases shading cost. Multisample antialiasing (MSAA) stores multiple coverage and depth samples per pixel while often evaluating the expensive fragment shader fewer times; it is efficient for geometric edges but less effective for shader-generated discontinuities. Analytical antialiasing computes exact or approximate coverage from geometry. Post-process methods, such as edge-aware filters, infer edges from a completed image and are inexpensive but may blur or miss subpixel features. Temporal antialiasing combines information from successive frames using motion estimates. It can improve apparent resolution, but disocclusion, moving objects, and inaccurate motion vectors may cause ghosting. Antialiasing is therefore a sampling problem as much as a filtering problem: the reconstruction filter, sample pattern, and temporal behavior all matter. Visibility: Culling, Depth, and Surface RemovalBack-Face CullingFor a closed surface, polygons facing away from the camera may be invisible. Back-face culling rejects them before rasterization. In screen space, the signed area of a projected triangle indicates its orientation. A positive or negative sign is classified as front-facing according to the chosen winding convention. The convention must be consistent with transformations and coordinate-system handedness. Culling is an optimization, not a complete visibility solution. It cannot reject front-facing surfaces hidden behind other front-facing surfaces. It is also inappropriate for two-sided materials, transparent sheets, foliage requiring both sides, or geometry whose winding is unreliable. The Depth BufferThe z-buffer is the standard real-time hidden-surface method. A depth value is stored for each pixel sample. When a fragment arrives, its depth is compared with the stored value. If it passes the selected test—usually “less than” for a conventional setup—the fragment color and depth replace the previous values. The method is attractive because it is local, order-independent for opaque surfaces, and easy to integrate with triangle rasterization. Its memory cost is proportional to screen resolution and sample count. A 24-bit or 32-bit depth representation is common, but precision is affected strongly by the ratio of far to near clipping distances. Increasing the near-plane distance, reducing the far-plane distance, or using reversed-Z with a floating-point depth buffer can improve precision. Depth fighting, or z-fighting, occurs when two surfaces have nearly identical depth values and quantization makes their ordering unstable. Remedies include separating surfaces, using polygon offset carefully, improving depth precision, or redesigning the geometry. Alternative Hidden-Surface MethodsThe painter’s algorithm sorts surfaces from farthest to nearest and draws them in that order. It is conceptually simple, but intersecting or cyclically overlapping polygons may have no valid global order. Splitting polygons can solve some cases at additional cost. A scanline hidden-surface algorithm maintains active polygon edges and depth information while processing each scanline. It can exploit coherence but is more complex than a z-buffer and less natural for modern highly parallel hardware. An object-space method compares geometric surfaces before rasterization. Such methods can be exact and may avoid per-pixel storage, but pairwise comparisons can become expensive. A BSP tree recursively partitions space and supports ordered traversal, historically useful in static environments. The painter’s algorithm, BSP trees, and scanline methods remain valuable conceptually and in specialized applications, although depth buffering dominates many real-time pipelines. Transparency requires special treatment. A conventional depth buffer correctly handles opaque surfaces but can incorrectly discard fragments when transparent surfaces overlap. A common approach renders opaque geometry first, then sorts transparent objects back-to-front and blends them. This is approximate for intersecting transparent geometry. More advanced methods include depth peeling, weighted blended order-independent transparency, and per-pixel linked lists. An Integrated Rasterization PipelineA practical triangle pipeline can be understood as a sequence of dependent decisions: 1. Transform vertices from model coordinates through world, view, and projection transformations. 2. Perform clipping in homogeneous coordinates against the view volume. 3. Apply perspective division and viewport transformation. 4. Determine triangle orientation and perform back-face culling if enabled. 5. Establish a screen-space bounding box. 6. Evaluate edge functions at sample locations. 7. Generate fragments for covered samples using a consistent fill convention. 8. Interpolate depth and shader attributes, using perspective correction where required. 9. Execute fragment shading and optional tests such as alpha or stencil tests. 10. Perform depth and blending operations before writing the framebuffer. The order is significant. Culling before clipping can be problematic for primitives whose projected orientation is not yet valid. Interpolating after perspective division without accounting for w produces incorrect texture coordinates. Performing depth testing after blending can produce incorrect transparency. Robust implementations make these dependencies explicit. Applied Case Study: A Web-Based Architectural ViewerBackgroundConsider an illustrative architectural viewer that displays a large building model in a browser. The model contains opaque walls, glass panels, thin metal rails, textured floors, and thousands of repeated window elements. Users can orbit the camera, zoom into details, and switch between day and night lighting. Situation and ProblemThe initial implementation renders every polygon, produces shimmering railings during camera motion, shows occasional cracks between wall triangles, and displays flickering surfaces where decorative overlays lie close to the underlying walls. Transparent glass also appears in an inconsistent order. AnalysisProfiling shows that many objects outside the camera view are sent to rasterization. The model uses inconsistent triangle winding after some imported transformations, and the renderer uses a pixel-center test with no multisampling. Texture coordinates are linearly interpolated after projection rather than perspective-correctly. The overlay geometry differs from the walls by a very small depth, causing z-fighting. Glass is rendered in the same pass as opaque surfaces, so depth writes and blending interact incorrectly. Approach and SolutionThe rendering team first adds hierarchical view-frustum culling at the object and sub-object levels. Each mesh is clipped against the view volume, while back-face culling is enabled for closed opaque geometry after winding conventions are normalized. Triangle rasterization uses consistent edge rules, eliminating cracks along shared edges. Perspective-correct interpolation is used for texture coordinates and material parameters. MSAA is enabled for ordinary geometric edges, and temporal accumulation is applied cautiously to reduce camera-motion shimmer. Overlay surfaces use a controlled depth offset rather than arbitrary geometric separation. Opaque objects are rendered first with depth writes enabled. Glass is then rendered with depth testing but restricted depth writes, using a back-to-front order for major transparent objects. Thin railings are given alpha-tested or stochastic coverage treatment depending on the material. OutcomeThe number of rasterized fragments decreases substantially because of culling and early depth rejection. Texture distortion disappears, shared triangle boundaries become stable, and overlay flicker is reduced. Glass ordering is not mathematically perfect for intersecting panes, but the selected approximation is visually acceptable and considerably faster than full per-pixel depth peeling. Learning PointsThe case demonstrates that visual defects rarely have a single cause. A crack may result from inconsistent edge rules, a shimmer from insufficient sampling, and a flicker from inadequate depth precision. Effective engineering combines geometric correctness, sampling theory, visibility algorithms, asset conventions, and performance measurement rather than treating rasterization as an isolated drawing routine. Challenges, Limitations, and Common MistakesA frequent mistake is assuming that a pixel is a point. This leads to inadequate coverage decisions and aliasing. Another is interpolating all attributes linearly in screen space, which breaks perspective-dependent quantities. Inconsistent inclusion rules at shared edges create seams between adjacent triangles. Performing clipping after perspective division can generate invalid results near the camera plane. Depth-buffer errors often arise from an unnecessarily close near plane, an excessively distant far plane, or inappropriate depth offsets. Back-face culling fails when imported meshes use mixed winding orders or contain intentional two-sided surfaces. Transparency is often treated as if it were opaque, despite its dependence on ordering and blending. Numerical robustness is also important. Very small triangle areas, nearly parallel clipping intersections, and coordinates with large magnitudes can cause precision loss. Implementations should use tolerances carefully, avoid unstable divisions, and test degenerate and boundary cases. Performance must be evaluated using both primitive counts and fragment counts: a small number of large, overlapping triangles may cost more than many small triangles. Professional and Ethical ConsiderationsRasterization is used in engineering visualization, medical imaging, geographic systems, simulation, education, entertainment, and user interfaces. In safety-critical or scientific contexts, misleading depth cues, inaccurate antialiasing, or hidden geometry can affect interpretation. Developers should document coordinate systems, depth conventions, precision limits, and transparency assumptions. Accessibility also matters. Visual distinctions based only on subtle shading or antialiasing may be unavailable to users with impaired vision or on low-quality displays. In regulated or evidence-producing applications, rendering should be reproducible, and changes in hardware, sample patterns, or driver behavior should be tested. A visually plausible image is not automatically a geometrically faithful representation. Current DevelopmentsModern GPUs combine fixed-function rasterization with programmable stages and increasingly sophisticated visibility techniques. Variable-rate shading changes the number of shading evaluations across regions of an image. Conservative rasterization guarantees coverage for primitives that touch a sample region, which is useful in collision, voxelization, and visibility applications. Mesh shaders can reorganize primitive generation and culling before rasterization. Hybrid renderers combine rasterization with ray tracing for selected effects such as reflections and shadows. Software techniques also continue to evolve. Temporal reconstruction uses motion vectors and history buffers to produce high apparent resolution at moderate cost. Hierarchical depth buffers support early occlusion culling. Clustered and tiled approaches organize visibility and shading spatially. These developments do not eliminate classical rasterization principles; they build upon coverage rules, interpolation, sampling, and depth testing. Best Practices for ImplementationA dependable rasterizer should: - define coordinate, winding, depth, and boundary conventions explicitly;
- clip in the correct coordinate space before perspective division;
- use one consistent edge-ownership rule for adjacent primitives;
- support incremental edge evaluation for efficient triangle coverage;
- apply perspective-correct interpolation to appropriate attributes;
- choose near and far planes to preserve depth precision;
- separate opaque and transparent rendering strategies;
- validate degenerate, clipped, boundary-touching, and subpixel primitives;
- measure fragment overdraw as well as vertex and triangle throughput;
- test with wireframes, depth visualizations, coverage masks, and deliberately difficult geometry.
Chapter SummaryRasterization converts continuous primitives into discrete samples and fragments. DDA provides a straightforward incremental line method, while Bresenham achieves efficient integer line drawing. The midpoint circle algorithm exploits eight-way symmetry. Polygon filling can use scanlines, and triangle rasterization commonly uses edge functions and barycentric coordinates. Consistent boundary rules are essential for avoiding cracks and double coverage. Clipping removes invisible portions of primitives; Cohen–Sutherland uses outcodes, Liang–Barsky computes a parametric interval, and Sutherland–Hodgman clips polygons boundary by boundary. Interpolation supplies fragment attributes, but perspective projection requires perspective-correct rather than purely affine interpolation. Antialiasing addresses sampling artifacts through supersampling, multisampling, analytical coverage, and temporal methods. Back-face culling rejects surfaces that cannot be visible under appropriate assumptions. The depth buffer provides an efficient per-sample visibility solution for opaque geometry, while painter’s algorithms, scanline methods, BSP structures, and depth-peeling techniques serve specialized purposes. A robust pipeline depends on the interaction of clipping, coverage, interpolation, sampling, depth precision, and blending. Key TermsRasterization: Conversion of geometric primitives into discrete image samples. Scan conversion: The process of determining which raster samples are covered by a primitive. Fragment: A candidate pixel-sample record containing depth, color, and interpolated attributes. Coverage: The degree or logical status to which a primitive occupies a pixel or sample. DDA: An incremental line algorithm based on floating-point coordinate steps. Bresenham algorithm: An efficient integer-based line rasterization algorithm. Midpoint circle algorithm: An incremental circle method based on an implicit decision function. Edge function: An oriented linear function used to test a point’s position relative to an edge. Barycentric coordinates: Weights expressing a point as a combination of triangle vertices. Clipping: Removal or modification of primitive portions outside a permitted region. Cohen–Sutherland clipping: Line clipping using endpoint region outcodes. Liang–Barsky clipping: Parametric line clipping using entering and exiting parameter values. Sutherland–Hodgman clipping: Sequential polygon clipping against window boundaries. Perspective-correct interpolation: Attribute interpolation that accounts for projective division. Antialiasing: Sampling or filtering techniques that reduce aliasing artifacts. Back-face culling: Rejection of primitives oriented away from the viewer. Depth buffer: Per-sample storage used to retain the nearest visible depth. Z-fighting: Unstable visibility caused by insufficient depth precision between nearby surfaces. Overdraw: Repeated fragment processing for the same pixel or sample. Hidden-surface removal: Determination of which surfaces are visible at image samples. Review QuestionsShort Answer Questions1. Why is a rasterized output described in terms of fragments rather than only pixels? 2. State the principal difference between DDA and Bresenham line rasterization. 3. What is the purpose of an edge function in triangle rasterization? 4. Why must texture coordinates normally be interpolated perspectively? 5. What information does a depth buffer store? Long Answer Questions1. Explain Bresenham’s line algorithm, including its decision variable and treatment of different octants. 2. Describe triangle scan conversion using edge functions and barycentric coordinates. 3. Compare Cohen–Sutherland and Liang–Barsky line clipping algorithms. 4. Explain the operation of a depth buffer and discuss the causes and remedies of z-fighting. 5. Discuss antialiasing methods and compare their quality, cost, and suitability for real-time rendering. Analytical / Application Questions1. A renderer displays cracks between adjacent triangles that share vertices. Diagnose possible rasterization causes and propose a robust correction. 2. A textured triangle becomes increasingly distorted toward its far edge after perspective projection. Explain the error mathematically and specify the required interpolation method. 3. Design a visibility strategy for a scene containing opaque buildings, transparent windows, thin foliage, and coplanar decals. Justify the order of culling, depth testing, blending, and antialiasing operations. 22. Multiple Choice Questions with AnswersQuestion 1For a line with |Δx| greater than |Δy|, what does a standard DDA implementation typically use as the number of steps? A. |Δy| B. |Δx| C. Δx + Δy D. The line length squared Correct Answer: B. |Δx| Question 2What is the principal advantage of Bresenham’s line algorithm over the basic DDA method? A. It produces infinitely thin continuous lines B. It requires no endpoint coordinates C. It can use incremental integer arithmetic D. It automatically performs perspective correction Correct Answer: C. It can use incremental integer arithmetic Question 3Why can a point inside a counterclockwise triangle be identified using consistently signed edge functions? A. Each edge function is a depth value B. The point lies on the same oriented side of every edge C. The triangle always has equal edge lengths D. Edge functions remove the need for vertex coordinates Correct Answer: B. The point lies on the same oriented side of every edge Question 4Which clipping algorithm directly computes the entering and exiting parameter values of a line segment? A. Cohen–Sutherland B. Liang–Barsky C. Midpoint circle D. Bresenham Correct Answer: B. Liang–Barsky Question 5What problem is caused by counting a shared polygon vertex inconsistently during scan conversion? A. Perspective distortion B. Depth-buffer precision C. Gaps or double-filled boundary samples D. Loss of circle symmetry Correct Answer: C. Gaps or double-filled boundary samples Question 6Which interpolation method is normally required for correct texture mapping across a perspective-projected triangle? A. Constant interpolation B. Screen-space linear interpolation without correction C. Perspective-correct interpolation D. Nearest-vertex interpolation Correct Answer: C. Perspective-correct interpolation Question 7Back-face culling can safely reject a primitive when which assumption generally holds? A. The primitive is transparent and two-sided B. The surface is closed and back-facing surfaces are invisible C. The primitive has zero area D. The depth buffer is disabled Correct Answer: B. The surface is closed and back-facing surfaces are invisible Question 8What is the primary purpose of a depth buffer in opaque rendering? A. To smooth geometric edges B. To store texture coordinates C. To retain the closest fragment at each sample D. To sort all objects before transformation Correct Answer: C. To retain the closest fragment at each sample Question 9Which change generally improves conventional depth precision most directly? A. Moving the near plane closer to the camera B. Increasing the far-to-near ratio C. Moving the near plane farther from the camera D. Disabling clipping Correct Answer: C. Moving the near plane farther from the camera Question 10A renderer blends transparent objects in arbitrary order while allowing each object to write depth. What is the most likely result? A. Correct order-independent transparency in all cases B. Transparent surfaces may incorrectly occlude one another C. Automatic perspective correction D. Improved back-face classification Correct Answer: B. Transparent surfaces may incorrectly occlude one another
|