Lesson 112 +10 XP

Rendering Paths

Rendering Paths

A rendering path determines how Unity calculates lighting, shadows, and surfaces.

Forward Rendering

Forward rendering renders each object individually. Lighting is calculated for each light affecting the object.

  • Pros: Low GPU memory bandwidth overhead, runs on mobile, supports MSAA anti-aliasing, handles transparency easily.
  • Cons: Performance scales poorly with high light counts. If an object is affected by N lights, it requires N passes.

Deferred Rendering

Deferred rendering splits geometry and lighting passes:

  1. Geometry Pass: Surface parameters (color, normals, specular, depth) are written to screenspace textures called the G-Buffer.
  2. Lighting Pass: The G-Buffer is sampled to calculate lighting per pixel in screenspace.
  • Pros: Performance is independent of light counts. You can have hundreds of realtime lights.
  • Cons: No native MSAA support, high GPU memory bandwidth usage, does not render transparent materials (which must fallback to a forward pass).

Forward+ (Universal Render Pipeline)

URP features Forward+, which divides the screen into a tile grid and registers active lights per tile. This allows objects to sample multiple lights in a single pass, matching forward rendering quality with higher light counts.

TL;DR

  • Choose Forward for mobile hardware or MSAA requirements.
  • Choose Deferred for dense PC/Console scenes with high counts of real-time lights.
  • Use Forward+ in URP to optimize scenes with medium-to-high light counts.