82
Lighting you up in Battlefield 3 Kenny Magnusson (DICE) GDC 2011

Lighting you up in Battlefield 3

  • Upload
    dice

  • View
    109.617

  • Download
    3

Embed Size (px)

DESCRIPTION

his session presents a detailed overview of the new lighting system implemented in DICEs Frostbite 2 engine and how it enables us to stretch the boundaries of lighting in BATTLEFIELD 3 with its highly dynamic, varied and destructible environments. BATTLEFIELD 3 goes beyond the lighting limitations found in our previous battlefield games, while avoiding costly and static prebaked lighting without compromising quality. We discuss the technical implementation of the art direction in BATTLEFIELD 3, the workflows we created for it as well as how all the individual lighting components fit together: deferred rendering, HDR, dynamic radiosity and particle lighting.

Citation preview

Page 1: Lighting you up in Battlefield 3

Lighting you up in Battlefield 3Kenny Magnusson (DICE)

GDC 2011

Page 2: Lighting you up in Battlefield 3

Agenda:›Past:›Battlefield and Mirror's edge

›Want:›The best from both worlds›Improvements›Real-time radiosity lighting system

›Frostbite 2

›How:›Real time radiosity architecture›Small environments›Large environments›Lights›Best practice

›Conclusion:

›Summary:

Page 3: Lighting you up in Battlefield 3

PAST:Battlefield Bad

Company Frostbite 1

Mirror’s EdgeUnreal Engine 3

Page 4: Lighting you up in Battlefield 3

PAST:

›Forward-rendering›No streaming›Hemispherical sky/ground light + directional sun light › 3 point lighting

›100% Dynamic shadows, cascaded shadowmaps› 3 slices, 1024x1024

›Single (!) point light per object›No Global Illumination›No Screen Space Ambient Occlusion›Static sky occlusion maps for buildings & bigger objects

›Static sky occlusion volumes for indoor environments that dynamic objects sampled a single value from

›Forward-rendering›Streaming›Static world / static lighting

› Illuminate Labs Beast Offline Generation› Global Illumination (bounce, emissive, translucent)› Stored as directional lightmaps (Radiosity Normal Maps)

›Dynamic objects (i.e. Faith)› Pre-calculated light probes form basis for relighting

dynamic objects› Combine most relevant probes to form SH basis for

lighting› Extract major light axis as “directional light source”› Use conventional shadow mapping from extracted

directional

Battlefield Bad Company

Frostbite 1

Mirror’s EdgeUnreal Engine 3

Page 5: Lighting you up in Battlefield 3

WANT:

How could we get the best from both worlds?+ some more..

Page 6: Lighting you up in Battlefield 3

WANT:›GI In a highly dynamic and destructible environment

Page 7: Lighting you up in Battlefield 3

WANT:›Indoor

Page 8: Lighting you up in Battlefield 3

WANT:›Outdoor

Page 9: Lighting you up in Battlefield 3

WANT:›Large environments with reflective surfaces

Page 10: Lighting you up in Battlefield 3

WANT:›Lights

Page 11: Lighting you up in Battlefield 3

WANT:

Improvements

Page 12: Lighting you up in Battlefield 3

WANT:›Improvements›Deferred rendering

Page 13: Lighting you up in Battlefield 3

WANT:›Improvements›Deferred rendering›More lighting models

Page 14: Lighting you up in Battlefield 3

WANT:›Improvements›Deferred rendering›More lighting models›Translucency

Page 15: Lighting you up in Battlefield 3

WANT:›Improvements›Deferred rendering›More lighting models›Translucency›Faster workflows

Page 16: Lighting you up in Battlefield 3

WANT:›Improvements›Deferred rendering›More lighting models›Translucency›Faster workflows›Simultaneous

Page 17: Lighting you up in Battlefield 3

WANT:›Improvements›Deferred rendering›More lighting models›Translucency›Faster workflows›Simultaneous›Particle lighting

Page 18: Lighting you up in Battlefield 3

WANT:›Improvements›Deferred rendering›More lighting models›Translucency›Faster workflows›Simultaneous›Particle lighting›Bloom

Page 19: Lighting you up in Battlefield 3

WANT:›Improvements›Deferred rendering›More lighting models›Translucency›Faster workflows›Simultaneous›Particle lighting›Bloom›Filmic Tonemapping

Page 20: Lighting you up in Battlefield 3

WANT:›Real-time radiosity lighting system›Enlighten› Geomerics

› Cambridge, UK based. Spun out of Cambridge University

› Collaborated over many years› Works for all platforms

› PLAYSTATION®3,XBox 360™, PC for Windows.

Page 21: Lighting you up in Battlefield 3

WANT:›Frostbite 2

Page 22: Lighting you up in Battlefield 3

HOW:

”Realtime radiosity architecture for a game”How does the full lighting pipeline work in Battlefield 3

Page 23: Lighting you up in Battlefield 3

HOW: Specular

Page 24: Lighting you up in Battlefield 3

HOW: Diffuse

Page 25: Lighting you up in Battlefield 3

HOW: Specular bounce

Page 26: Lighting you up in Battlefield 3

HOW: Diffuse bounce

Page 27: Lighting you up in Battlefield 3

HOW: Pre‐baked lightmaps

Page 28: Lighting you up in Battlefield 3

HOW: Typical lightmap

Page 29: Lighting you up in Battlefield 3

HOW: Placing direct lights

Page 30: Lighting you up in Battlefield 3

HOW: Radiosity

Page 31: Lighting you up in Battlefield 3

HOW:

Page 32: Lighting you up in Battlefield 3

HOW:

Page 33: Lighting you up in Battlefield 3

HOW:

Page 34: Lighting you up in Battlefield 3

HOW:

›Lightmap lit geometry› Large and inanimate› Receive and bounce light› Static geometry

›Lightprobe lit geometry› Small and organic› Only receive light› Cant bounce light› Dynamic and static

geometry

Page 35: Lighting you up in Battlefield 3

HOW:

Page 36: Lighting you up in Battlefield 3

HOW:

Page 37: Lighting you up in Battlefield 3

HOW:

Page 38: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry

Page 39: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Detail geometry

Page 40: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Detail geometry

› UVs generated by projection

Page 41: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Detail geometry

› UVs generated by projection

› No additional lighting data

Page 42: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Detail geometry

› UVs generated by projection

› No additional lighting data

› “Off-axis” lighting comes from directional data in lightmap

Page 43: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Detail geometry

› UVs generated by projection

› No additional lighting data

› “Off-axis” lighting comes from directional data in lightmap

›Target geometry

Page 44: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Detail geometry

› UVs generated by projection

› No additional lighting data

› “Off-axis” lighting comes from directional data in lightmap

›Target geometry› Has simple UV surface

area

Page 45: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Detail geometry

› UVs generated by projection

› No additional lighting data

› “Off-axis” lighting comes from directional data in lightmap

›Target geometry› Has simple UV surface

area› Poly count is not

important› Various authoring

options

Page 46: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Authoring of geometry› UVs

Detail geometry UV Target geometry UV

Page 47: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Authoring of geometry› UVs› Surface transfer

Detail geometry UVTransferred to the

Target geometry UV

Page 48: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Authoring of geometry› UVs› Surface transfer

Detail geometry UVTransferred to the

Target geometry UV

Page 49: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Authoring of geometry› UVs› Surface transfer

Target geometry lightmap

Page 50: Lighting you up in Battlefield 3

HOW:›Lightmap lit geometry›Authoring of geometry› UVs› Surface transfer

Target geometry lightmapTransferred to the Detail geometry

Page 51: Lighting you up in Battlefield 3

HOW:›Lightprobe lit geometry›Lightprobe volumes

Page 52: Lighting you up in Battlefield 3

HOW:›Lightprobe lit geometry›Lightprobe volumes

Page 53: Lighting you up in Battlefield 3

HOW:›Lightprobe lit geometry›Lightprobe volumes

Page 54: Lighting you up in Battlefield 3

HOW:›Precompute›Analyze the geometry

Page 55: Lighting you up in Battlefield 3

HOW:›Runtime lighting pipeline1.Radiosity pass (CPU)

› Update indirect lightmaps and lightprobes

2.Geometry pass (GPU)› Store indirect lighting in separate G-

buffer

3.Light pass (GPU)› Render deferred light sources› Add indirect lighting from G-buffer

Page 56: Lighting you up in Battlefield 3

HOW:›Small environments›Sky visibility

Page 57: Lighting you up in Battlefield 3

HOW:›Small environments›Sky visibility ›Environment maps

Page 58: Lighting you up in Battlefield 3

HOW:›Large environments›Skylight

Page 59: Lighting you up in Battlefield 3

HOW:›Large environments›Skylight

Page 60: Lighting you up in Battlefield 3

HOW:›Large environments›Skylight

Page 61: Lighting you up in Battlefield 3

HOW:›Large environments›Skylight ›Terrain

Page 62: Lighting you up in Battlefield 3

HOW:›Large environments›Skylight ›Terrain

Page 63: Lighting you up in Battlefield 3

HOW:›Large environments›Skylight ›Terrain

Page 64: Lighting you up in Battlefield 3

HOW:›Light

Page 65: Lighting you up in Battlefield 3

HOW:›Light

Page 66: Lighting you up in Battlefield 3

HOW:›Light

Page 67: Lighting you up in Battlefield 3

HOW:

Why is it important to separate some elements in the lighting system?

Page 68: Lighting you up in Battlefield 3

HOW:›Best practice›Complex geometry

Page 69: Lighting you up in Battlefield 3

HOW:›Best practice›Complex geometry›Static radiosity maps

Page 70: Lighting you up in Battlefield 3

HOW:›Best practice›Complex geometry›Static radiosity maps›Real-time

Page 71: Lighting you up in Battlefield 3

HOW:›Best practice›Complex geometry›Static radiosity maps›Real-time›Streaming

Page 72: Lighting you up in Battlefield 3

HOW:›Best practice›Complex geometry›Static radiosity maps›Real-time›Streaming›Time laps

Page 73: Lighting you up in Battlefield 3

HOW:›Best practice›Complex geometry›Static radiosity maps›Real-time›Streaming›Time laps›Range

Page 74: Lighting you up in Battlefield 3

HOW:›Best practice›Complex geometry›Static radiosity maps›Real-time›Streaming›Time laps›Range›Color Grading› ON

Page 75: Lighting you up in Battlefield 3

HOW:›Best practice›Complex geometry›Static radiosity maps›Real-time›Streaming›Time laps›Range›Color Grading› OFF

Page 76: Lighting you up in Battlefield 3

HOW:›Best practice›Complex geometry›Static radiosity maps›Real-time›Streaming›Time laps›Range›Color Grading›Filmic tone mapping› ON

Page 77: Lighting you up in Battlefield 3

HOW:›Best practice›Complex geometry›Static radiosity maps›Real-time›Streaming›Time laps›Range›Color Grading›Filmic tone mapping› OFF

Page 78: Lighting you up in Battlefield 3

CONCLUSION:The advantagesTime› Fast workflow allowing for more iterations

Time› Design changes are not as painful

Unified lighting system› One system to light everything

Page 79: Lighting you up in Battlefield 3

CONCLUSION:The disadvantagesMemory› The radiosity maps uses ‘some’ memory

Performance› Dependent on light probe density› Size and amount of pointlights

Authoring of geometry› It takes time› Grasp the concept

Precompute› Can take time depending on size of level

Page 80: Lighting you up in Battlefield 3

SUMMARY:Workflow

› It’s dynamic and fast › Different › Analyze the geometry

PC› Memory › Fully dynamic in game lighting

Consoles› Memory issue› Not fully dynamic› Shadows realtime› Lightprobes› Only intensity not directional

Page 81: Lighting you up in Battlefield 3

I want to thank the following:

Per Einarsson, Torbjörn Malmer

Johan AnderssonRobert Kihl

Joakim SvärlingChristina Ann Coffin

Oscar CarlenAndrew Hamilton

Page 82: Lighting you up in Battlefield 3

Mon 1:45 DX11 Rendering in Battlefield 3 Johan Andersson

Wed 10:30

SPU-based Deferred Shading in Battlefield 3 for PlayStation 3

Christina Coffin

Wed 3:00 Culling the Battlefield: Data Oriented Design in Practice

Daniel Collin

Thu 1:30 Lighting You Up in Battlefield 3 Kenny Magnusson

Fri 4:05 Approximating Translucency for a Fast, Cheap & Convincing Subsurface Scattering Look

Colin Barré-Brisebois

Questions? Email: [email protected]: [email protected]

For more DICE talks: http://publications.dice.se

Battlefield 3 & Frostbite 2 talks at GDC’11: