SlideShare a Scribd company logo
1 of 45
Kuba Cupisz &
Tobias Alexander Franke
Progressive Lightmapper: An introduction to lightmapping
in Unity
Unity Technologies
Progressive Lightmapper:
An introduction to
lightmapping in Unity
Who are we?
Kuba
Cupisz
Tobias Alexander
Franke
The problem with
Lightmapping...
press
wait…
Milliseconds
Progressive updates View prioritization
Today’s menu
• Optimizing content for the Progressive Lightmapper
• i.e. “What can you do to make baking faster”
• A sneak peak into the GPU backend for the Progressive Lightmapper
• i.e. “What we are doing to make baking faster”
• Future developments
• i.e. “What we have in store to make baking more convenient”
Part 1: Optimizing
baking in the
Progressive
Lightmapper
Global
Illumination:
Gambling with
photons until
you think you
have won
Lightmapping at a glance
An overview of the parameters
• Direct Samples
• Number of rays shot towards light sources
• Indirect Samples
• Number of paths shot in the upper hemisphere
• Bounces
• Number of times a ray is allowed to bounce of another surface
An overview of the parameters
An overview of the parameters
An overview of the parameters
Understanding texels
• Pixels in lightmap
• Mapped to units of space
• Texel count is proportional to resolution^2
• Each texel spawns:
• n direct rays towards k lights
• m indirect rays * j bounces
• one direct ray per bounce towards k lights
• Texels are the amount of work to do
• Texels are the amount of work to
1 Texel per Unit 2 Texels per Unit 5 Texels per Unit
You don’t need to bake texels if you
don’t put them into the lightmap!
Keep a low texel count
• Do not waste (a lot of) texels on these:
• Surfaces with low variation
• Surfaces which receive indirect bounce light only
• Small objects
• Thin objects
• Surfaces hidden from the player
Albedo Baked Lightmap Shaded
Scale objects with low variation
• Scale “unimportant” objects to
reduce texel count
• Good targets:
• Small objects
• Objects which receive almost
uniform lighting
• e.g. the wall in the back
Can be represented with few texels
Needs many texels,
otherwise shadow will be blurry
Light Modes
• Subtractive
• Baked direct and indirect
• Shadowmask
• Save additional lightmap information to composite realtime and baked
shadows correctly
• Indirect only
• Baked indirect only
• Realtime direct light and shadows
Shadowmask/Subtractive Baked Indirect
Remove small/low-influence
objects entirely
Remove small/low-influence
objects entirely
Probe lighting
• Use probes for small or thin objects, and for
small-ish objects that would use too many texels
• Fences
• Wires
• Tubes
• Trees
• “Decoration”
• …
• Quick to compute, fairly low lookup cost
(not)Lightmapping LODs
• Marking all LODs in an LOD Group as lightmap static
• Each renderer gets lightmap texels
• Slow bakes
• Lower LODs need to be processed one by one
• Not enough work to saturate the hardware
• Raytracer’s acceleration structure needs to be changed
• Can be slow
(not)Lightmapping LODs - projection
• Marking only LOD0 in an LOD Group as lightmap static
• Only renderers in LOD0 get lightmap texels
• Lower LODs reuse those texels
• UVs need to match between LOD levels
• Same UV island outline, simpler topology inside
• Bakes are fast again
• All renderers processed in one go
• Raytracer’s acceleration structure is static
(not)Lightmapping LODs - projection
Matching UVs
(not)Lightmapping LODs - projection
27.5k/13.7k/6.9k triangles
(not)Lightmapping LODs - projection
Same distance
(not)Lightmapping LODs - projection
Actual usage in game
(not)Lightmapping LODs - projection
• Will be released as scripts soon
• Copy lightmap scale/offset and lightmap index
• From LOD0 to lower LODs
• Fully built-in in one of the coming releases
Filtering
• Post process to filter out noise by applying a “blur”
• Two variants
• Gaussian
• Edge-Aware A-Trous
• Used to fix small amounts of noise
• How NOT to optimize
• Lower sample count to bake fast
• Counter noise with more filtering
400 Samples Gauss Filter A-Trous Filter 400K Samples
400 Samples Gauss Filter A-Trous Filter 400K Samples
An overview of the parameters
• Lightmap Padding
• Space between UV islands
• Lightmap Size
• Max atlas width/height
Part 2: The GPU baking
backend
Speedup
AMD RadeonRays
• OpenCL based
• Cross platform
• Vendor agnostic
• Wavefront compute based
• Small simple kernels
• Quite a lot of them
• Can fall back to CPU
Part 3: The Future
The Future
• C# Raytracing API
• Support for multiple GPUs
• in one desktop
• laptop (with internal GPU + eGPUs)
• Features
• MIS
• Better probe handling
Take-away
• Minimize texel count for faster baking
• Use probes wherever possible, but most importantly for small objects
• Scale objects in lightmaps if they have low lighting variation
• Use appropriate light modes
• Try to avoid baking high-frequency details
• Indirect light is usually very blurry/low-frequency, no need for many texels
• GPU Lightmapper
• Future development
Thank you!
Q&A

More Related Content

What's hot

Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)
Tiago Sousa
 
A Bit More Deferred Cry Engine3
A Bit More Deferred   Cry Engine3A Bit More Deferred   Cry Engine3
A Bit More Deferred Cry Engine3
guest11b095
 
Forward+ (EUROGRAPHICS 2012)
Forward+ (EUROGRAPHICS 2012)Forward+ (EUROGRAPHICS 2012)
Forward+ (EUROGRAPHICS 2012)
Takahiro Harada
 

What's hot (20)

DD18 - SEED - Raytracing in Hybrid Real-Time Rendering
DD18 - SEED - Raytracing in Hybrid Real-Time RenderingDD18 - SEED - Raytracing in Hybrid Real-Time Rendering
DD18 - SEED - Raytracing in Hybrid Real-Time Rendering
 
Rendering Tech of Space Marine
Rendering Tech of Space MarineRendering Tech of Space Marine
Rendering Tech of Space Marine
 
Lighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow FallLighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow Fall
 
The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2
 
Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)
 
The Unique Lighting of Mirror's Edge
The Unique Lighting of Mirror's EdgeThe Unique Lighting of Mirror's Edge
The Unique Lighting of Mirror's Edge
 
A Bit More Deferred Cry Engine3
A Bit More Deferred   Cry Engine3A Bit More Deferred   Cry Engine3
A Bit More Deferred Cry Engine3
 
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in FrostbitePhysically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
 
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time RaytracingCEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
 
Forward+ (EUROGRAPHICS 2012)
Forward+ (EUROGRAPHICS 2012)Forward+ (EUROGRAPHICS 2012)
Forward+ (EUROGRAPHICS 2012)
 
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...
 
Graphics Gems from CryENGINE 3 (Siggraph 2013)
Graphics Gems from CryENGINE 3 (Siggraph 2013)Graphics Gems from CryENGINE 3 (Siggraph 2013)
Graphics Gems from CryENGINE 3 (Siggraph 2013)
 
Lightmapping for beginners- Unite Copenhagen 2019
Lightmapping for beginners- Unite Copenhagen 2019Lightmapping for beginners- Unite Copenhagen 2019
Lightmapping for beginners- Unite Copenhagen 2019
 
Stochastic Screen-Space Reflections
Stochastic Screen-Space ReflectionsStochastic Screen-Space Reflections
Stochastic Screen-Space Reflections
 
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero DawnThe Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
 
Light prepass
Light prepassLight prepass
Light prepass
 
Shiny PC Graphics in Battlefield 3
Shiny PC Graphics in Battlefield 3Shiny PC Graphics in Battlefield 3
Shiny PC Graphics in Battlefield 3
 
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open Problems
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open ProblemsHPG 2018 - Game Ray Tracing: State-of-the-Art and Open Problems
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open Problems
 
Real-time lightmap baking
Real-time lightmap bakingReal-time lightmap baking
Real-time lightmap baking
 

Similar to Progressive Lightmapper: An Introduction to Lightmapping in Unity

liquid crystal display
liquid crystal displayliquid crystal display
liquid crystal display
Dinesh Pasi
 
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted Malaska
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted MalaskaTop 5 Mistakes When Writing Spark Applications by Mark Grover and Ted Malaska
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted Malaska
Spark Summit
 

Similar to Progressive Lightmapper: An Introduction to Lightmapping in Unity (20)

【Unite 2018 Tokyo】プログレッシブライトマッパーの真価を発揮する秘訣
【Unite 2018 Tokyo】プログレッシブライトマッパーの真価を発揮する秘訣【Unite 2018 Tokyo】プログレッシブライトマッパーの真価を発揮する秘訣
【Unite 2018 Tokyo】プログレッシブライトマッパーの真価を発揮する秘訣
 
Deferred shading
Deferred shadingDeferred shading
Deferred shading
 
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...
 
october23.ppt
october23.pptoctober23.ppt
october23.ppt
 
Felwyrld Tech
Felwyrld TechFelwyrld Tech
Felwyrld Tech
 
Deferred Lighting and Post Processing on PLAYSTATION®3
Deferred Lighting and Post Processing on PLAYSTATION®3Deferred Lighting and Post Processing on PLAYSTATION®3
Deferred Lighting and Post Processing on PLAYSTATION®3
 
Photogrammetry and Star Wars Battlefront
Photogrammetry and Star Wars BattlefrontPhotogrammetry and Star Wars Battlefront
Photogrammetry and Star Wars Battlefront
 
CR & DR..(5).pptx
CR & DR..(5).pptxCR & DR..(5).pptx
CR & DR..(5).pptx
 
Taking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next GenerationTaking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next Generation
 
LED,LCD,CRO,CRT UNIT IV of M&I
LED,LCD,CRO,CRT UNIT IV of M&ILED,LCD,CRO,CRT UNIT IV of M&I
LED,LCD,CRO,CRT UNIT IV of M&I
 
november29.ppt
november29.pptnovember29.ppt
november29.ppt
 
[UniteKorea2013] The Unity Rendering Pipeline
[UniteKorea2013] The Unity Rendering Pipeline[UniteKorea2013] The Unity Rendering Pipeline
[UniteKorea2013] The Unity Rendering Pipeline
 
Develop2012 deferred sanchez_stachowiak
Develop2012 deferred sanchez_stachowiakDevelop2012 deferred sanchez_stachowiak
Develop2012 deferred sanchez_stachowiak
 
liquid crystal display
liquid crystal displayliquid crystal display
liquid crystal display
 
A new Post-Processing Pipeline
A new Post-Processing PipelineA new Post-Processing Pipeline
A new Post-Processing Pipeline
 
A modern Post-Processing Pipeline
A modern Post-Processing PipelineA modern Post-Processing Pipeline
A modern Post-Processing Pipeline
 
Practical usage of Lightmass in Architectural Visualization (Kenichi Makaya...
Practical usage of Lightmass in  Architectural Visualization  (Kenichi Makaya...Practical usage of Lightmass in  Architectural Visualization  (Kenichi Makaya...
Practical usage of Lightmass in Architectural Visualization (Kenichi Makaya...
 
3D processing and metadata ingestion at POLIMI, Gabriele Guidi, Sara Gonizzi ...
3D processing and metadata ingestion at POLIMI, Gabriele Guidi, Sara Gonizzi ...3D processing and metadata ingestion at POLIMI, Gabriele Guidi, Sara Gonizzi ...
3D processing and metadata ingestion at POLIMI, Gabriele Guidi, Sara Gonizzi ...
 
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark ApplicationsTop 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
 
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted Malaska
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted MalaskaTop 5 Mistakes When Writing Spark Applications by Mark Grover and Ted Malaska
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted Malaska
 

More from Unity Technologies

More from Unity Technologies (20)

Build Immersive Worlds in Virtual Reality
Build Immersive Worlds  in Virtual RealityBuild Immersive Worlds  in Virtual Reality
Build Immersive Worlds in Virtual Reality
 
Augmenting reality: Bring digital objects into the real world
Augmenting reality: Bring digital objects into the real worldAugmenting reality: Bring digital objects into the real world
Augmenting reality: Bring digital objects into the real world
 
Let’s get real: An introduction to AR, VR, MR, XR and more
Let’s get real: An introduction to AR, VR, MR, XR and moreLet’s get real: An introduction to AR, VR, MR, XR and more
Let’s get real: An introduction to AR, VR, MR, XR and more
 
Using synthetic data for computer vision model training
Using synthetic data for computer vision model trainingUsing synthetic data for computer vision model training
Using synthetic data for computer vision model training
 
The Tipping Point: How Virtual Experiences Are Transforming Global Industries
The Tipping Point: How Virtual Experiences Are Transforming Global IndustriesThe Tipping Point: How Virtual Experiences Are Transforming Global Industries
The Tipping Point: How Virtual Experiences Are Transforming Global Industries
 
Unity Roadmap 2020: Live games
Unity Roadmap 2020: Live games Unity Roadmap 2020: Live games
Unity Roadmap 2020: Live games
 
Unity Roadmap 2020: Core Engine & Creator Tools
Unity Roadmap 2020: Core Engine & Creator ToolsUnity Roadmap 2020: Core Engine & Creator Tools
Unity Roadmap 2020: Core Engine & Creator Tools
 
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...
 
Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019
 
Turn Revit Models into real-time 3D experiences
Turn Revit Models into real-time 3D experiencesTurn Revit Models into real-time 3D experiences
Turn Revit Models into real-time 3D experiences
 
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...How Daimler uses mobile mixed realities for training and sales - Unite Copenh...
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...
 
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...
 
QA your code: The new Unity Test Framework – Unite Copenhagen 2019
QA your code: The new Unity Test Framework – Unite Copenhagen 2019QA your code: The new Unity Test Framework – Unite Copenhagen 2019
QA your code: The new Unity Test Framework – Unite Copenhagen 2019
 
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...
 
Supplying scalable VR training applications with Innoactive - Unite Copenhage...
Supplying scalable VR training applications with Innoactive - Unite Copenhage...Supplying scalable VR training applications with Innoactive - Unite Copenhage...
Supplying scalable VR training applications with Innoactive - Unite Copenhage...
 
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...XR and real-time 3D in automotive digital marketing strategies | Visionaries ...
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...
 
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
 
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
 
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
 
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
 

Recently uploaded

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Recently uploaded (20)

WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid Environments
 
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 

Progressive Lightmapper: An Introduction to Lightmapping in Unity

  • 1. Kuba Cupisz & Tobias Alexander Franke Progressive Lightmapper: An introduction to lightmapping in Unity Unity Technologies
  • 2. Progressive Lightmapper: An introduction to lightmapping in Unity
  • 6. Progressive updates View prioritization
  • 7. Today’s menu • Optimizing content for the Progressive Lightmapper • i.e. “What can you do to make baking faster” • A sneak peak into the GPU backend for the Progressive Lightmapper • i.e. “What we are doing to make baking faster” • Future developments • i.e. “What we have in store to make baking more convenient”
  • 8. Part 1: Optimizing baking in the Progressive Lightmapper
  • 11. An overview of the parameters • Direct Samples • Number of rays shot towards light sources • Indirect Samples • Number of paths shot in the upper hemisphere • Bounces • Number of times a ray is allowed to bounce of another surface
  • 12. An overview of the parameters
  • 13. An overview of the parameters
  • 14. An overview of the parameters
  • 15. Understanding texels • Pixels in lightmap • Mapped to units of space • Texel count is proportional to resolution^2 • Each texel spawns: • n direct rays towards k lights • m indirect rays * j bounces • one direct ray per bounce towards k lights • Texels are the amount of work to do • Texels are the amount of work to
  • 16. 1 Texel per Unit 2 Texels per Unit 5 Texels per Unit
  • 17. You don’t need to bake texels if you don’t put them into the lightmap!
  • 18. Keep a low texel count • Do not waste (a lot of) texels on these: • Surfaces with low variation • Surfaces which receive indirect bounce light only • Small objects • Thin objects • Surfaces hidden from the player
  • 20. Scale objects with low variation • Scale “unimportant” objects to reduce texel count • Good targets: • Small objects • Objects which receive almost uniform lighting • e.g. the wall in the back Can be represented with few texels Needs many texels, otherwise shadow will be blurry
  • 21. Light Modes • Subtractive • Baked direct and indirect • Shadowmask • Save additional lightmap information to composite realtime and baked shadows correctly • Indirect only • Baked indirect only • Realtime direct light and shadows
  • 25. Probe lighting • Use probes for small or thin objects, and for small-ish objects that would use too many texels • Fences • Wires • Tubes • Trees • “Decoration” • … • Quick to compute, fairly low lookup cost
  • 26. (not)Lightmapping LODs • Marking all LODs in an LOD Group as lightmap static • Each renderer gets lightmap texels • Slow bakes • Lower LODs need to be processed one by one • Not enough work to saturate the hardware • Raytracer’s acceleration structure needs to be changed • Can be slow
  • 27. (not)Lightmapping LODs - projection • Marking only LOD0 in an LOD Group as lightmap static • Only renderers in LOD0 get lightmap texels • Lower LODs reuse those texels • UVs need to match between LOD levels • Same UV island outline, simpler topology inside • Bakes are fast again • All renderers processed in one go • Raytracer’s acceleration structure is static
  • 28. (not)Lightmapping LODs - projection Matching UVs
  • 29. (not)Lightmapping LODs - projection 27.5k/13.7k/6.9k triangles
  • 30. (not)Lightmapping LODs - projection Same distance
  • 31. (not)Lightmapping LODs - projection Actual usage in game
  • 32. (not)Lightmapping LODs - projection • Will be released as scripts soon • Copy lightmap scale/offset and lightmap index • From LOD0 to lower LODs • Fully built-in in one of the coming releases
  • 33. Filtering • Post process to filter out noise by applying a “blur” • Two variants • Gaussian • Edge-Aware A-Trous • Used to fix small amounts of noise • How NOT to optimize • Lower sample count to bake fast • Counter noise with more filtering
  • 34. 400 Samples Gauss Filter A-Trous Filter 400K Samples
  • 35. 400 Samples Gauss Filter A-Trous Filter 400K Samples
  • 36. An overview of the parameters • Lightmap Padding • Space between UV islands • Lightmap Size • Max atlas width/height
  • 37. Part 2: The GPU baking backend
  • 38.
  • 40. AMD RadeonRays • OpenCL based • Cross platform • Vendor agnostic • Wavefront compute based • Small simple kernels • Quite a lot of them • Can fall back to CPU
  • 41. Part 3: The Future
  • 42. The Future • C# Raytracing API • Support for multiple GPUs • in one desktop • laptop (with internal GPU + eGPUs) • Features • MIS • Better probe handling
  • 43. Take-away • Minimize texel count for faster baking • Use probes wherever possible, but most importantly for small objects • Scale objects in lightmaps if they have low lighting variation • Use appropriate light modes • Try to avoid baking high-frequency details • Indirect light is usually very blurry/low-frequency, no need for many texels • GPU Lightmapper • Future development
  • 45. Q&A