Back to Lighting

Part 1: THE RENDERING PIPELINE

~21 min5 sections

What you'll learn:

  • How Unreal's deferred rendering pipeline processes your scene
  • What the G-Buffer stores and why it matters for lighting
  • The order in which lighting, shadows, reflections, and effects are calculated
  • How this pipeline maps to what we'll cover in this course

Why Start Here?

Before we can light a scene, we need to understand how Unreal processes what you see. The rendering pipeline determines the order in which lighting, shadows, reflections, and effects are calculated — and this course follows that same order.

You don't need to memorize every stage right now. As we progress through the course, this pipeline will start to make more sense. Think of it as a companion reference — something you can return to whenever you want to understand where a particular effect fits in the overall process.

UE5 Deferred Rendering Pipeline
Interactive flowchart showing all 14 stages — from scene setup through swap chain to display.

Section 1: What is Deferred Rendering? (5 min)

"Deferred" means lighting calculation is delayed until after all geometry is processed. Instead of calculating lighting for each object as it's drawn (which is expensive), deferred rendering:

  1. First pass: Render all geometry and store surface data in buffers
  2. Second pass: Calculate lighting per-pixel using that stored data

This separation is what enables Unreal to handle hundreds of dynamic lights without performance scaling per-object.

Traditional (Forward):    Object → Light → Light → Light → Draw
                         (repeat for every object)

Deferred:                 All Objects → Store Data → Calculate All Lights → Draw
                         (lighting done once, per-pixel)

In forward rendering, each object must be processed against every light that affects it. With 100 objects and 50 lights, that's potentially 5,000 lighting calculations.

In deferred rendering, lighting is calculated per-pixel on screen. A 1920×1080 display has ~2 million pixels, but that count stays constant regardless of scene complexity.


Section 2: The G-Buffer (5 min)

The G-Buffer (Geometry Buffer) is a collection of screen-space textures that store all the surface information needed to calculate lighting later.

BufferWhat It StoresUsed For
Base Color (Albedo)Surface color without any lightingDiffuse lighting calculation
World NormalSurface direction at each pixelDetermines how light bounces
RoughnessHow blurry vs sharp reflections appearSpecular/reflection calculation
MetallicWhether surface is metal (1) or dielectric (0)Changes how light interacts
DepthDistance from cameraShadows, AO, volumetrics
VelocityPer-pixel motion vectorsMotion blur, TAA

When you adjust a material's roughness or metallic value, you're changing what gets written to the G-Buffer. The lighting pass then reads these values to determine:

  • How much light bounces diffusely vs reflects specularly
  • How sharp or blurry reflections appear
  • Whether the surface tints reflections (metals) or not (dielectrics)

Visualization: You can view G-Buffer contents in the viewport using View Mode → Buffer Visualization to see exactly what data Unreal has stored for each pixel.


Section 3: The Full Pipeline (8 min)

Unreal's deferred pipeline processes your scene in this order:

1. Scene Setup & Culling
   └─ Determine what's visible

2. Geometry Pass → G-Buffer
   └─ Store surface data for all visible meshes

3. Shadows
   └─ Calculate shadow maps for all lights

4. Direct Lighting
   └─ Sun, point lights, spotlights, rect lights

5. Ambient/Sky Lighting
   └─ Sky light contribution

6. Ambient Occlusion
   └─ Darken corners and crevices

7. Indirect Lighting (GI)
   └─ Bounced light via Lumen

8. Reflections
   └─ Screen-space + Lumen reflections

9. Translucency
   └─ Glass, particles, volumetrics

10. Post Process
    └─ Bloom, exposure, color grading

11. Final Output
    └─ Image sent to display
Pipeline StageCourse Part
Scene Setup & CullingPart 2: Project Setup
Geometry → G-Buffer(Materials - not covered)
ShadowsPart 3-4: Direct Lighting
Direct LightingPart 3-4: Direct Lighting
Ambient/Sky LightingPart 6-7: Ambient Lighting
Ambient OcclusionPart 8-9: Ambient Occlusion
Indirect Lighting (GI)Part 10-11: Indirect Lighting
ReflectionsPart 12-13: Reflections
Post ProcessPart 14-17: Bloom, Exposure & Cameras

This is the roadmap for the course. We'll work through each stage in order, building understanding layer by layer.


Section 4: Why Deferred? (3 min)

Deferred rendering enables:

  • Hundreds of dynamic lights — lighting is calculated per-pixel, not per-object
  • Complex global illumination — Lumen relies on the G-Buffer data
  • Screen-space effects — reflections, ambient occlusion, and more
  • Decoupled systems — lighting artists can work independently of geometry complexity

Deferred isn't perfect:

LimitationWhy It Happens
Transparency is complexTransparent objects can't write to G-Buffer normally (multiple surfaces per pixel)
No MSAAG-Buffer doesn't support multi-sample anti-aliasing; we use TAA instead
Memory bandwidthG-Buffer requires significant memory, especially at high resolutions
Single material per pixelCan't blend materials in screen-space

Forward rendering calculates lighting per-object as it's drawn. Unreal supports this for:

  • VR optimization (lower latency)
  • MSAA anti-aliasing (not available in deferred)
  • Certain transparency/hair rendering techniques

For this course, we use deferred rendering (the default) because it's required for Lumen and most modern UE5 lighting features.

Setting: Project Settings → Engine → Rendering → Forward Renderer → Forward Shading: Off (this is the default)


Key Points:

  • Deferred rendering delays lighting until after geometry is processed
  • The G-Buffer stores surface data: color, normals, roughness, metallic, depth
  • Lighting is calculated per-pixel using G-Buffer data, enabling many lights efficiently
  • This pipeline order (Geometry → Shadows → Lighting → Post Process) is the course structure
  • Deferred enables Lumen, screen-space effects, and complex lighting scenarios
  • Trade-offs include transparency complexity and no native MSAA

Now that you understand how Unreal builds your image, in Part 2: Project Setup we'll configure the project settings that control these systems — setting up Lumen, ray tracing, and disabling the default post-process effects so you can see exactly what each lighting element contributes.