Forward rendering

Also known as: forward shading

On this page 7

Forward rendering, also called forward shading, is a rendering architecture in which every object is rasterized and fully shaded in a single pass, with the fragment shader evaluating all relevant lights before writing a final color to the framebuffer. In Real-time 3D, it is the classic approach used by GPUs since fixed-function hardware, and it remains the default path in many engines, WebGL libraries and virtual reality applications.

The method is straightforward: geometry goes in, lit pixels come out. Its main weakness is cost that grows with the number of objects multiplied by the number of lights, which is why modern variants such as Forward+ and clustered forward shading add a light-culling step to keep that cost under control.

How forward rendering produces a frame

Forward rendering produces a frame by drawing each visible mesh once and computing its final lit color immediately inside the fragment shader. The vertex shader transforms positions into clip space, rasterization generates fragments, and the fragment shader samples textures, evaluates the material model and sums the contribution of every light that affects the object.

Because lighting happens at draw time, the depth test decides only afterward whether a shaded fragment survives. Fragments hidden by closer geometry may have been fully shaded and then discarded, a waste known as overdraw. Engines reduce it by sorting opaque objects front to back or by running a depth prepass that fills the Z-buffer before the expensive shading pass.

The table below lists the stages of a typical forward pipeline and what each one contributes.

StageWhat happensMain cost driver
CullingFrustum and occlusion culling remove invisible objectsObject count
Shadow passesDepth maps are rendered for shadow-casting lightsLights with shadows
Depth prepass (optional)Depth only, no shading, fills the Z-bufferVertex count
Opaque passEach object is shaded with all affecting lightsPixels times lights
Transparent passSorted back to front and blendedOverlapping layers
Post-processingTone mapping, bloom, anti-aliasingScreen resolution
Stages of a typical forward rendering frame

Variants of forward shading

Forward shading exists in several variants that differ mainly in how lights are assigned to objects or pixels. Classic single-pass forward rendering passes a fixed array of lights, often four to eight per object, as shader uniforms. Multi-pass forward rendering draws an object once per light and blends the results additively, which supports many lights but multiplies draw calls.

Forward+, also called tiled forward shading, divides the screen into tiles of roughly 16 by 16 pixels and uses a compute shader to build a list of lights touching each tile. Clustered forward shading extends the tiles into depth slices, so lights are culled in three dimensions and long view distances no longer inflate the light lists.

VariantLight assignmentPractical light budgetTypical use
Single-pass forwardFixed list per objectAbout 4-8 per objectMobile, WebGL, stylized games
Multi-pass forwardOne pass per lightModerate, limited by draw callsOlder engines
Forward+ (tiled)Per screen tile via computeHundreds per framePC and console games
Clustered forwardPer 3D cluster via computeThousands per frameLarge scenes, VR
Main variants of forward rendering

Forward rendering compared with deferred shading

Forward rendering differs from deferred shading in when lighting is computed. Deferred shading first writes surface attributes such as albedo, normals and roughness into a G-buffer, then computes lighting in screen space, so shading cost depends on pixels and lights rather than on scene complexity. Forward rendering skips the G-buffer and shades during rasterization.

The choice is a trade-off between memory bandwidth and lighting flexibility. A G-buffer at 4K resolution can occupy well over 100 MB and must be written and read every frame, which is expensive on tile-based mobile GPUs. Forward rendering, in contrast, handles transparency, MSAA and varied materials without special workarounds.

PropertyForward renderingDeferred shading
Many dynamic lightsCostly without Forward+Efficient
TransparencyNative supportNeeds a separate forward pass
MSAACheap and directExpensive or impractical
Material varietyAny shader per objectLimited by G-buffer layout
Memory bandwidthLowHigh
Screen-space effectsNeed extra buffersG-buffer data readily available
Forward rendering and deferred shading side by side

When to choose forward rendering

Forward rendering is the better choice when bandwidth is scarce, anti-aliasing quality matters or materials vary widely. Virtual reality favors it because MSAA produces sharp edges at the high resolutions and frame rates of headsets, typically 72 to 120 frames per second per eye. Browser frameworks such as Three.js and Babylon.js use forward paths because WebGL offers limited support for multiple render targets on older devices.

SituationRecommended pathReason
Mobile or standalone VRForward or Forward+Saves bandwidth, enables MSAA
WebGL applicationForwardBroad device compatibility
Night city with hundreds of lightsClustered forward or deferredLight culling is essential
Glass, foliage, particlesForwardTransparency without workarounds
Heavy screen-space effectsDeferred or forward with prepassNormals and depth are required
Decision guide for choosing a rendering path

Hybrid pipelines are common in practice. Many engines render opaque geometry with deferred shading and then switch to a forward pass for transparent objects, while others render everything forward and generate a thin normal buffer only for effects such as screen space ambient occlusion.

Limitations and common mistakes

The main limitation of classic forward rendering is shader permutation growth. Supporting different light counts and types often requires compiling many shader variants, which increases build times and can cause stutter when variants compile at runtime. A second issue is wasted shading on hidden fragments when no depth prepass is used.

  • Assuming forward rendering cannot handle many lights; Forward+ and clustered shading remove most of that restriction.
  • Skipping the depth prepass in scenes with heavy overdraw, such as dense forests.
  • Letting every light affect every object instead of culling lights by range.
  • Ignoring that shadow-casting lights remain expensive in any rendering path.

The short version

Forward rendering paints each object in a 3D scene one at a time, fully lit. The computer draws a chair and decides its final color right away. It checks every lamp that shines on the chair. Then it moves on to the next object.

This is simple and fast with a few lights. It also handles glass and smoke well. The weak spot is many lights. Each extra lamp adds work for every object it touches. Modern versions first sort out which lamps matter for each part of the screen, so they stay fast.

Where it makes a difference

A small studio builds a standalone VR training app for a headset that must hold 90 frames per second at roughly 1,800 by 1,900 pixels per eye. An early prototype with deferred shading drops to 60 frames per second, because writing and reading the G-buffer saturates the mobile GPU’s memory bandwidth, and edges shimmer since MSAA is unavailable.

The team switches to single-pass forward rendering with 4x MSAA, limits each object to one directional light plus up to four local lights, and bakes the static lighting into lightmaps. The frame rate returns to a stable 90 frames per second, edges become clean, and the transparent safety-glass panels in the training room render without a separate pass.