a real time radiosity architecture for video games sam martin, per einarsson geomerics, dice
TRANSCRIPT
![Page 1: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/1.jpg)
A Real Time Radiosity Architecture for Video Games
Sam Martin, Per Einarsson
Geomerics, DICE
![Page 2: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/2.jpg)
Radiosity Architecture
• Hot topic: real time radiosity– Research focus on algorithms– Several popular “categories” of algorithm
• Architecture– Structure surrounding the algorithm– Use case: Integration in Frostbite 2
![Page 3: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/3.jpg)
Agenda
• Enlighten– Overview– Architectural Features
• Frostbite– Overview – Pipelines– Demo
• Summary / Questions
![Page 4: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/4.jpg)
Overview: Goals And Trade-offs
• XBox360, PS3, Multi-core PCsTarget current consoles
• Cost and quality must be scalableFlexible toolkit, not fixed solution
• Cannot sacrifice VQ for real timeMaintain visual quality
• Physically based but controllable“Believability” over accuracy
![Page 5: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/5.jpg)
Four Key Architectural Features
1. Separate lighting pipeline
2. Single bounce with feedback
3. Lightmap output
4. Relighting from target geometry
![Page 6: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/6.jpg)
“Arches”
![Page 7: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/7.jpg)
Enlighten Pipeline
Precompute
• Decompose scene into systems• Project detail geometry to target geometry for relighting• Distill target shape for real time radiosity
Runtime
• Render direct lighting as usual (GPU)• Asynchronously generate radiosity (CPU)• Combine direct and indirect shading on GPU
![Page 8: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/8.jpg)
Runtime Lighting Pipeline
On target mesh
On detail mesh + indirect specular
Standard lighting
Point-sampled input to Enlighten
PointSpotDirectionalEnvironmentAreaUser-specified
+ radiosity from previous frame
Direct Light Sources
Final GPU composite
![Page 9: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/9.jpg)
Direct Lighting
![Page 10: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/10.jpg)
Point Sampled Direct Lighting
![Page 11: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/11.jpg)
Enlighten Output (Target)
![Page 12: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/12.jpg)
Enlighten Output (Detail)
![Page 13: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/13.jpg)
Final Composite
![Page 14: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/14.jpg)
Model single bounce with feedback
Bounce feedback scale = 1.0 Bounce feedback scale = 0.0
![Page 15: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/15.jpg)
Enlighten Lightmap Output
106 x 106 texels90% coverage “Directional
Irradiance”
“Spherical”
![Page 16: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/16.jpg)
Target Geometry
Has simple UV surface area
Tri count not important
Various authoring options
![Page 17: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/17.jpg)
Detail Geometry
UVs generated by projection
No additional lighting data
“Off-axis” lighting comes from directional data in lightmap
Does not interact with radiosity
![Page 18: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/18.jpg)
Example UV Projection
![Page 19: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/19.jpg)
Recap: Architectural Features
1. Separate lighting pipeline
2. Single bounce with feedback
3. Lightmap output
4. Relighting from target geometry
![Page 20: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/20.jpg)
Agenda
• Enlighten– Quick overview, Key decisions, The future
• Frostbite– Motivation– Pipeline– Runtime– Demo
• QA?
![Page 21: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/21.jpg)
Motivation
• Why real-time radiosity in Frostbite?
- Workflows and iteration times
- Dynamic environments
- Flexible architecture
![Page 22: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/22.jpg)
Precompute pipeline
1. Classify static and dynamic objects
2. Generate radiosity systems
3. Parametrize static geometry
4. Generate runtime data
![Page 23: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/23.jpg)
1. Static & dynamic geometry
• Static objects receive and bounce light- Uses dynamic lightmaps
• Dynamic object only receive light- Samples lighting from lightprobes
Mesh classification Underlying geometry Transferred lightingInput scene
![Page 24: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/24.jpg)
2. Radiosity systems
• Processed and updated in parallel • Input dependencies control light transport• Used for radiosity granularity
Systems Input dependencies
![Page 25: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/25.jpg)
3. Parametrization
Automatic uv projection System atlases
• Static meshes uses target geometry- Target geometry is used to compute radiosity- Project detail mesh onto target mesh to get uvs
• Systems packed into separate uv atlases
![Page 26: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/26.jpg)
4. Runtime data generation
Distributed precompute pipeline generates runtime datasets for dynamic radiosity updates
• One dataset per system (streaming friendly)• Distributed precompute with Incredibuild’s XGI• Data dependent on geometry only (not light or albedo)•
![Page 27: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/27.jpg)
Rendering
• Separate direct light / radiosity pipeline- CPU: radiosity
- GPU: direct light & compositing
• Frostbite uses deferred rendering- All lights can bounce dynamic radiosity
• Separate lightmap / lightprobe rendering- Lighmaps rendered in forward pass
- Lightprobes added to 3D textures and rendered deferred
![Page 28: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/28.jpg)
Runtime pipeline
1) Radiosity pass (CPU) Update indirect lightmaps & lightprobes Lift lightprobes into 3D textures
2) Geometry pass (GPU) Add indirect lightmaps to separate g-buffer Use stencil buffer to mask out dynamic objects
3) Light pass (GPU) Render deferred light sources Add lightmaps from g-buffer Add lightprobes from 3D textures
![Page 29: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/29.jpg)
Direct lightingRadiosity
![Page 30: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/30.jpg)
Direct light
![Page 31: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/31.jpg)
Lightmaps
![Page 32: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/32.jpg)
Lightprobes
![Page 33: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/33.jpg)
Final composite
![Page 34: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/34.jpg)
Demo
![Page 35: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/35.jpg)
Summary / Questions?
• Thanks!
![Page 36: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/36.jpg)
Bonus Extras! Enlighten Future
• Replace lightmaps?• Shift more towards data parallel?• Incremental update vs fixed cost?• Split lighting integral by distance?
![Page 37: A Real Time Radiosity Architecture for Video Games Sam Martin, Per Einarsson Geomerics, DICE](https://reader033.vdocument.in/reader033/viewer/2022061304/5513c48d55034646298b4b3d/html5/thumbnails/37.jpg)