3DRenderingAgency

3D rendering explained

What is rasterization in rendering?

Rasterization is the 3D rendering method that converts a scene's triangles into the pixels of a 2D image by working out which pixels each triangle covers. It is fast enough to draw a new frame many times a second, which is why games and real-time architectural tools such as Enscape, Lumion and Unreal Engine are built on it.

By the 3DRenderingAgency team · Updated

A cabin's triangle mesh hovering over a pixel grid, its lower half already filled in as colored pixel squares.

Rasterization is one of the two main ways 3D rendering produces an image; the other is ray tracing. This page explains the 3D sense of the word on a simple house model, compares the two methods on one kitchen, and says when an architect would want each. The 2D sense, rasterizing a layer in Photoshop, gets its own short section near the end.

What does rasterization mean?

Rasterization means turning shapes described by points and lines into a grid of colored pixels. So what is rasterization in a 3D program? Every object in a scene is stored as triangles, each defined by three corner points in space. A screen is a raster: a fixed grid of pixels. Rasterization is the step that decides, for each triangle, which cells of that grid it covers. The Wikipedia article on rasterisation calls it computing the mapping from scene geometry to pixels, and stresses that it does not decide what color those pixels are; that is a separate shading step.

Because rasterization works triangle by triangle and never asks where light goes after it hits a surface, it is very fast. The same article notes it is used in most real-time 3D engines for exactly that reason.

How does rasterization work?

Rasterization projects each triangle onto the screen, finds the pixels it covers, keeps only the nearest surface with a depth buffer and then shades those pixels. In five steps:

  1. Transform the vertices. Move every triangle's corner points from the model's own coordinates into the camera's view, so the scene is seen from the chosen viewpoint.
  2. Project onto the screen. Flatten each triangle into 2D screen positions with perspective, so distant walls come out smaller than near ones.
  3. Find the covered pixels. Test which pixel centers fall inside each flattened triangle; each covered pixel becomes a fragment.
  4. Keep the nearest fragment. Compare each fragment's distance to the camera with the value already stored in the depth buffer, and keep it only if it is closer. A depth buffer, or z-buffer, stores the distance to the camera for every pixel, as Wikipedia's z-buffering article describes.
  5. Shade the pixels. Run a small program for each surviving pixel that applies the material's texture and estimates lighting, often with shadow maps and other precomputed tricks.
Triangles projected onto the pixel grid, with the depth buffer keeping the nearer wall.

The loop above runs those steps on a small gabled house. Each triangle of the roof and walls lands on the pixel grid in turn, and where the front wall and the side wall overlap, the depth buffer keeps the wall nearer the camera.

What is rasterization on a GPU?

On a GPU, rasterization is done by dedicated hardware that converts millions of triangles to pixels per frame, which is why graphics cards are built around it. The vertex transforms and pixel shading run on thousands of small parallel cores, and fixed-function units do the coverage test and depth comparison. According to Wikipedia's article on real-time computer graphics, real-time systems must draw each image in under a thirtieth of a second, and modern hardware handles millions of triangles per frame. Rasterization drives every real-time rendering engine: it is what lets an architect orbit a building model smoothly in a viewport.

A rasterized viewport redraws the whole model every frame as the camera moves.

Rasterization vs ray tracing: what is the difference?

Rasterization starts from the triangles and asks which pixels they cover, while ray tracing starts from each pixel and asks what light reaches it; rasterization is far faster, ray tracing far more accurate. The other method, ray tracing, follows light from each pixel into the scene and on to other surfaces, so reflections, refraction and bounced light come out of the calculation; modern graphics cards now run real-time ray tracing for exactly these effects. Rasterization has no idea what lies beyond the surface it is drawing, so a mirror, a glass wall or light bouncing off a floor must be faked with extra techniques. Asked the other way, ray tracing vs rasterization comes down to the same trade: speed against accuracy.

Rasterization and ray tracing compared
AspectRasterizationRay tracing
Starts fromEach triangle: which pixels does it cover?Each pixel: what light reaches it?
SpeedReal time: a frame in a fraction of a secondOffline stills take minutes to hours; real time only with hardware help and few rays
ReflectionsFaked with screen-space reflections or pre-rendered environment maps; misses what is off screenCalculated, including objects behind the camera
ShadowsShadow maps: fast, can look jagged or uniformly softTraced shadow rays: sharp at contact, softening with distance
Bounced lightPrecomputed lightmaps or screen-space approximationsCalculated over many bounces with path tracing
Typical useGames, CAD viewports, design review, walkthroughs, VRFilm, marketing stills, animation frames
Archviz toolsEnscape, Lumion, Twinmotion, Unreal Engine (with optional ray-traced effects)Corona, V-Ray, Blender Cycles
A navy kitchen split in two: on the rasterized left the glossy cabinets and window show only a generic sheen; on the ray-traced right they reflect the island, the brass pendants and the room.
The same kitchen rasterized (left) and ray traced (right), with the reflective surfaces circled.

In the kitchen above, the difference shows on the glossy surfaces. The rasterized half gives the lacquered cabinet fronts a generic sheen and the window glass a pale, featureless reflection. The traced half shows the island, the pendant lights and the garden outside in those same surfaces, which is what a client reads as "real".

Is rasterization still relevant today?

Rasterization is still the basis of almost all real-time graphics; even ray-traced games rasterize the scene first and trace only selected effects. Hardware ray tracing has added accurate reflections and shadows to real-time images, but the visible surfaces are still found by rasterization because it is so much cheaper. Only full path tracing drops rasterization entirely, and in real time it needs top-end hardware. The difference between hybrid and full path tracing is set out in path tracing vs ray tracing.

What does it mean to rasterize an image in Photoshop?

In Photoshop and other 2D tools, to rasterize means converting vector shapes or text into pixels, a different use of the word from 3D rasterization. A vector shape is stored as an outline that can scale to any size; a rasterized layer is a fixed grid of pixels that can be painted, filtered and blended. You rasterize a layer by choosing the rasterize command on it, and you do it when a tool needs pixels to work on, such as a brush, a blur or a filter. In rendering, Photoshop is used for Photoshop post-production, where every rendered image is already a raster and rasterized layers are normal.

When do we use rasterized real-time tools?

Real-time, rasterized tools suit fast previews, interactive walkthroughs and VR, while offline ray-traced engines suit final marketing stills. At 3DRenderingAgency, where the people making the images have designed buildings themselves, final stills, animation frames and 360 panoramas are path traced in Corona or V-Ray in 3ds Max, because every reflection and corner has to hold up at 4K. Where a viewer needs to move freely through a building, a real-time engine is the right tool, and our real-time rendering software page compares the options architects use. Our real estate 3D virtual tours use rendered panoramas so each view keeps full traced light, and free-roaming scenes are built in Unreal Engine 5 for virtual reality real estate viewing, with Lumen lighting keeping them close to our stills, so buyers can walk a home before it exists.

Questions

What are the disadvantages of raster graphics?

Raster images lose sharpness when enlarged beyond their pixel count, which is why a render for a billboard must be rendered at a higher resolution than one for a web page.

Is rasterization the same as rendering?

No. Rasterization is one rendering method; rendering is the whole job of turning a 3D scene into an image, which can also be done by ray tracing.

Ready when you are

Tell us what you need and send your files. A fixed quote comes back within 12 hours, and a first draft in 3 to 5 business days.