Rasterization is the process of converting geometric primitives, almost always triangles, into the discrete pixels of a raster image by determining which pixels each primitive covers and computing a color for them. It is the foundation of Real-time 3D: games, interactive visualization, WebGL applications and virtual production all depend on it because modern GPUs execute it in dedicated hardware at enormous speed.
In 3D graphics & animation, rasterization is usually contrasted with ray tracing. Rasterization works object by object, projecting each triangle onto the screen, while ray tracing works pixel by pixel, tracing rays into the scene. The British spelling rasterisation describes the same technique.
How rasterization turns triangles into pixels
Rasterization is one stage within the larger graphics pipeline, preceded by geometry processing and followed by per-pixel shading and output merging. Each triangle passes through a fixed sequence of steps before it contributes to the final image.
The table below lists the main stages in the order a GPU performs them.
| Stage | What happens | Programmable |
|---|---|---|
| Vertex shading | Vertices are transformed into clip space | Yes, vertex shader |
| Clipping and culling | Off-screen and back-facing triangles are removed | No, fixed function |
| Perspective divide | Clip coordinates become normalized device coordinates | No, fixed function |
| Viewport transform | Coordinates are mapped to screen pixels | No, fixed function |
| Triangle setup and coverage | Pixels or samples inside the triangle are found | No, fixed function |
| Fragment shading | Color is computed for each covered pixel | Yes, fragment shader |
| Depth test and blending | Visibility is resolved and results are merged | Configurable |
Coverage is decided with edge functions, simple linear equations that tell on which side of each triangle edge a sample point lies. A sample inside all three edges belongs to the triangle. A strict top-left fill rule settles samples that lie exactly on a shared edge, so that adjacent triangles never draw the same pixel twice or leave a gap.
Interpolation, depth and visibility
Once a pixel is known to be covered, the rasterizer interpolates vertex attributes such as texture coordinates, normals and colors across the triangle using barycentric coordinates. Interpolation must be perspective-correct, dividing by depth, otherwise textures appear to swim and bend on surfaces that recede from the camera.
Rasterization by itself does not know which surface is in front. Visibility is solved by the Z-buffer, a per-pixel depth store: a new fragment is kept only if it is closer than the value already recorded. Limited depth precision causes Z-fighting when two surfaces lie almost at the same depth, a problem reduced by sensible near-plane distances or a reversed depth buffer with floating-point values.
The parameters below have the strongest influence on rasterization quality and cost.
| Parameter | Typical values | What it affects |
|---|---|---|
| Output resolution | 1080p to 4K per frame | Number of pixels shaded |
| MSAA sample count | 1, 2, 4 or 8 samples per pixel | Edge smoothness and memory |
| Depth buffer format | 24-bit integer or 32-bit float | Precision and Z-fighting |
| Triangle count | Thousands to millions per frame | Geometry load and small-triangle cost |
| Overdraw | One to several layers per pixel | Wasted fragment shading |
Rasterization compared with ray tracing
The essential difference is the direction of the question. Rasterization asks which pixels a given triangle covers, while ray tracing asks which surface a given pixel sees. This makes rasterization extremely efficient for primary visibility, but weak at effects that depend on light bouncing between surfaces.
| Aspect | Rasterization | Ray tracing |
|---|---|---|
| Loop order | For each triangle, find pixels | For each pixel, find surfaces |
| Speed on GPUs | Very high, mature hardware | Lower, accelerated by RT cores |
| Shadows | Approximated with shadow mapping | Computed with shadow rays |
| Reflections | Screen space or probe approximations | Physically traced reflections |
| Global illumination | Baked or approximated | Path traced, often denoised |
| Main use | Real-time rendering | Offline rendering, hybrid real time |
Most current engines are hybrid renderers: rasterization produces the G-buffer or primary image, and ray tracing adds selected effects such as reflections or shadows. Pure rasterization remains dominant on mobile devices and in WebGL.
Optimizing rasterization in real-time engines
Performance in a rasterizer depends on avoiding unnecessary work before and after the coverage stage. Many neighboring techniques in real-time 3D exist mainly to feed the rasterizer fewer or cheaper triangles.
- Frustum culling and occlusion culling discard objects that cannot appear on screen.
- Backface culling skips triangles facing away from the camera, roughly halving closed-mesh work.
- Level of detail swaps distant models for lighter versions with fewer triangles.
- Early depth testing and a depth prepass reject hidden fragments before expensive shading.
- Deferred shading separates geometry rasterization from lighting to limit lighting cost per pixel.
Mobile GPUs often use tile-based rasterization, dividing the screen into small tiles processed in on-chip memory to save bandwidth. Some modern engines also run software rasterization in compute shaders for very small triangles, where fixed-function hardware becomes inefficient.
Artifacts and limitations of rasterization
Because rasterization samples continuous geometry on a discrete pixel grid, it inherits sampling artifacts. The most visible is aliasing, the stair-step pattern on edges, along with several performance pitfalls that only appear at scale.
| Artifact | Cause | Remedy |
|---|---|---|
| Jagged edges | One coverage sample per pixel | MSAA, FXAA or temporal antialiasing |
| Z-fighting | Insufficient depth precision | Reversed float depth, adjusted near plane |
| Texture shimmering | Undersampled distant textures | Mipmapping and anisotropic filtering |
| Slow tiny triangles | 2×2 pixel quad shading overhead | Level of detail or software rasterizer |
| Shadow acne | Depth comparison errors in shadow maps | Depth bias and normal offset |
A common misconception is that rasterization is obsolete because of ray tracing. In practice, it remains the fastest method for primary visibility and is likely to stay at the core of interactive rendering for years, with ray tracing layered on top where quality justifies the cost.
In simple terms
A computer screen is a grid of tiny colored squares called pixels, while a 3D scene is made of flat triangles floating in space. Rasterization is the step that decides which squares each triangle covers and what color they should be.
Think of laying a stencil shaped like a triangle over graph paper and filling in every square inside its outline. The graphics card does this for millions of triangles, many times per second, and keeps only the nearest one at each square. This speed is why video games can draw detailed worlds instantly.
A practical example
A team developing a racing game for current consoles targets 60 frames per second at 1440p, which leaves about 16.7 milliseconds to render each frame. Profiling shows that a dense forest beside the track sends almost four million triangles to the rasterizer, many of them smaller than a pixel.
The engineers add aggressive level of detail for the trees, enable occlusion culling behind hills and introduce a depth prepass so that hidden leaves are rejected before the fragment shader runs. Overdraw in the forest drops from about five layers to under two. Frame time falls by roughly four milliseconds, and the game holds its 60 frame target without lowering resolution.