SlideShare une entreprise Scribd logo
1  sur  71
Advanced Lighting for Interactive Applications Shadow Algorithms Stefan Brabec Max-Planck-Institut für Informatik Saarbrücken, Germany
Overview ,[object Object],[object Object],[object Object],[object Object]
Motivation ,[object Object],[object Object],[object Object],[object Object]
Motivation ,[object Object],Hard shadow edges -  unreal (like geometry) + computation easier Soft shadow boundaries + realistic -  expensive
Algorithms for Hard Shadows ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Approximated Shadows ,[object Object],Images from TombRaider. ©Eidos Interactive.
Approximated Shadows ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Projected Geometry ,[object Object],[object Object],[object Object],[object Object]
Projected Geometry ,[object Object]
Projected Geometry ,[object Object]
Projected Geometry ,[object Object],[object Object]
Projected Geometry ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Projected Geometry ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Projected Geometry ,[object Object],1. Render scene without receiver polygon 2. Clear stencil buffer  3. Render receiver polygon - stencil operation ‘set’ (visible pixels) 4. Render shadow polygons - without depth test - stencil test ‘is set?’ - stencil operation ‘clear’ - blending e.g. ‘dest = dest * 0.2’ (darken)
Projected Geometry ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Projected Geometry ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shadow Volumes ,[object Object],[object Object],[object Object],[object Object]
Shadow Volumes ,[object Object],[object Object],[object Object],[object Object],[object Object],Light Source Shadow Region Occluder
Shadow Volumes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shadow Volumes ,[object Object],[object Object],[object Object]
Shadow Volumes ,[object Object],1. Render scene (ambient color) 2. Render front-facing parts of shadow volumes   with stencil operation  increment  (enter) 3. Render back-facing parts of shadow volumes   with stencil operation  decrement  (exit) 4. Render scene (fully lit)    with stencil test  equal zero
Shadow Volumes ,[object Object],[object Object],[object Object],Images from Mark Kilgard’s shadow volume demo (NVIDIA).
Shadow Volumes ,[object Object],[object Object],[object Object]
Shadow Volumes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shadow Volumes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shadow Maps ,[object Object],[object Object],[object Object]
Shadow Maps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shadow Maps Shadow map Final scene
Shadow Maps ,[object Object],[object Object],[object Object],[object Object]
Shadow Maps ,[object Object],[object Object],Brabec/Heidrich ‘Marilyn'. Image taken from OpenGL Programming Guide.  Projective texturing: Slide projector
Shadow Maps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shadow Maps ,[object Object],[object Object],[object Object]
Shadow Maps ,[object Object],[object Object],[object Object]
Shadow Maps ,[object Object],1. Render scene from light source view - 1D ramp texture or linear fog 2. Copy frame buffer (alpha channel) to texture 3. Render scene  shadowed  (ambient light only) 4. Render scene fully lit with alpha as - Tex #1: 2D shadow map (projective texture) - Tex #2: 1D linear ramp (distance to light) - Alpha test: clamp(Tex#2 - Tex#1) == 0  5. Add up illumination (blending)
Shadow Maps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shadow Maps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Hybrid Approach ,[object Object],[object Object],[object Object],[object Object],[object Object]
Hybrid Approach ,[object Object],1. Render scene from light source view (depth only) 2. Read back depth buffer 3. Reconstruct shadow volumes - Edge detection (Canny) - Surface reconstruction (Template matching) 4. Render shadow volume with stencil operation 5. Render final scene (stencil test)
Hybrid Approach
Hybrid Approach ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Extended Light Maps ,[object Object],[object Object],[object Object],[object Object],[object Object]
Extended Light Maps  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Extended Light Maps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Extended Light Maps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Extended Light Maps ,[object Object]
Extended Light Maps ,[object Object],[object Object],[object Object]
Extended Light Maps ,[object Object],[object Object],[object Object],[object Object],[object Object]
Extended Light Maps ,[object Object],[object Object],[object Object]
Algorithms for Soft Shadows ,[object Object],[object Object]
Sampling the Light Source ,[object Object],[object Object],[object Object],[object Object]
Sampling the Light Source ,[object Object],1. Initialize FB (white) 2. For each sample point do 2a. Render scene 2b. Subtract 1/N from FB   only once for each    pixel (stencil) ! Image from ATI Developer’s Site
Sampling the Light Source ,[object Object],Image from ATI Developer’s Site
Sampling the Light Source ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sampling the Light Source ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Soft Shadow Maps ,[object Object]
Soft Shadow Maps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Soft Shadow Maps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Soft Shadow Maps ,[object Object],[object Object],[object Object],Receiver Light Source Occluder
Soft Shadow Maps ,[object Object],[object Object],[object Object]
Soft Shadow Maps ,[object Object],[object Object],[object Object]
Soft Shadow Maps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Soft Shadow Maps ,[object Object],[object Object],left sample point right sample point camera view
Soft Shadow Maps ,[object Object]
Soft Shadow Maps ,[object Object]
Soft Shadow Maps ,[object Object],left sample point right sample point
Soft Shadow Maps ,[object Object],shade(p) { if( depth 1 (p) > S 1 [p] )  l 1  = 0; else l 1  = V 1 [p] * illum(p,L 1 ); if( depth 2 (p) > S 2 [p] )  l 2  = 0; else l 2  = V 2 [p] * illum(p,L 2 ); return l 1 +l 2 ; }
Soft Shadow Maps ,[object Object],[object Object]
Soft Shadow Maps
Soft Shadow Maps
Conclusion ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thank you !

Contenu connexe

Tendances

Deferred Rendering in Killzone 2
Deferred Rendering in Killzone 2Deferred Rendering in Killzone 2
Deferred Rendering in Killzone 2
ozlael ozlael
 
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
 
Introduction to Global Illumination by Aryo
Introduction to Global Illumination by AryoIntroduction to Global Illumination by Aryo
Introduction to Global Illumination by Aryo
Agate Studio
 

Tendances (20)

Deferred Rendering in Killzone 2
Deferred Rendering in Killzone 2Deferred Rendering in Killzone 2
Deferred Rendering in Killzone 2
 
Voxel based global-illumination
Voxel based global-illuminationVoxel based global-illumination
Voxel based global-illumination
 
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
 
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
 
Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
 
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)
 
Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666
 
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
Shiny Pixels and Beyond: Real-Time Raytracing at SEEDShiny Pixels and Beyond: Real-Time Raytracing at SEED
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
 
Volumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the FallenVolumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the Fallen
 
Introduction to Point Based Global Illumination (PBGI)
Introduction to Point Based Global Illumination (PBGI)Introduction to Point Based Global Illumination (PBGI)
Introduction to Point Based Global Illumination (PBGI)
 
Bending the Graphics Pipeline
Bending the Graphics PipelineBending the Graphics Pipeline
Bending the Graphics Pipeline
 
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal FilteringStable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
 
Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)
 
Extended Light Maps
Extended Light MapsExtended Light Maps
Extended Light Maps
 
Paris Master Class 2011 - 07 Dynamic Global Illumination
Paris Master Class 2011 - 07 Dynamic Global IlluminationParis Master Class 2011 - 07 Dynamic Global Illumination
Paris Master Class 2011 - 07 Dynamic Global Illumination
 
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
 
Introduction to Global Illumination by Aryo
Introduction to Global Illumination by AryoIntroduction to Global Illumination by Aryo
Introduction to Global Illumination by Aryo
 
A new Post-Processing Pipeline
A new Post-Processing PipelineA new Post-Processing Pipeline
A new Post-Processing Pipeline
 
Paris Master Class 2011 - 05 Post-Processing Pipeline
Paris Master Class 2011 - 05 Post-Processing PipelineParis Master Class 2011 - 05 Post-Processing Pipeline
Paris Master Class 2011 - 05 Post-Processing Pipeline
 

Similaire à Advanced Lighting for Interactive Applications

Interactive Stereoscopic Rendering for Non-Planar Projections (GRAPP 2009)
Interactive Stereoscopic Rendering for Non-Planar Projections (GRAPP 2009)Interactive Stereoscopic Rendering for Non-Planar Projections (GRAPP 2009)
Interactive Stereoscopic Rendering for Non-Planar Projections (GRAPP 2009)
Matthias Trapp
 
NVIDIA effects GDC09
NVIDIA effects GDC09NVIDIA effects GDC09
NVIDIA effects GDC09
IGDA_London
 
Non-Planar Projections (GRAPP 2008)
Non-Planar Projections (GRAPP 2008)Non-Planar Projections (GRAPP 2008)
Non-Planar Projections (GRAPP 2008)
Matthias Trapp
 

Similaire à Advanced Lighting for Interactive Applications (20)

Soft Shadow Maps for Linear Lights
Soft Shadow Maps for Linear LightsSoft Shadow Maps for Linear Lights
Soft Shadow Maps for Linear Lights
 
Interactive Stereoscopic Rendering for Non-Planar Projections (GRAPP 2009)
Interactive Stereoscopic Rendering for Non-Planar Projections (GRAPP 2009)Interactive Stereoscopic Rendering for Non-Planar Projections (GRAPP 2009)
Interactive Stereoscopic Rendering for Non-Planar Projections (GRAPP 2009)
 
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesBuild Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
 
Praseed Pai
Praseed PaiPraseed Pai
Praseed Pai
 
Gpu presentation
Gpu presentationGpu presentation
Gpu presentation
 
Computer Graphics Part1
Computer Graphics Part1Computer Graphics Part1
Computer Graphics Part1
 
Color and 3D Semantic Reconstruction of Indoor Scenes from RGB-D stream
Color and 3D Semantic Reconstruction of Indoor Scenes from RGB-D streamColor and 3D Semantic Reconstruction of Indoor Scenes from RGB-D stream
Color and 3D Semantic Reconstruction of Indoor Scenes from RGB-D stream
 
Advanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics APIAdvanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics API
 
CS 354 Pixel Updating
CS 354 Pixel UpdatingCS 354 Pixel Updating
CS 354 Pixel Updating
 
Rendering basics
Rendering basicsRendering basics
Rendering basics
 
Svr Raskar
Svr RaskarSvr Raskar
Svr Raskar
 
Interactive Refractions And Caustics Using Image Space Techniques
Interactive Refractions And Caustics Using Image Space TechniquesInteractive Refractions And Caustics Using Image Space Techniques
Interactive Refractions And Caustics Using Image Space Techniques
 
DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3
 
Icaros Photogrammetric Suite (IPS) Workflow
Icaros Photogrammetric Suite (IPS) WorkflowIcaros Photogrammetric Suite (IPS) Workflow
Icaros Photogrammetric Suite (IPS) Workflow
 
Understanding neural radiance fields
Understanding neural radiance fieldsUnderstanding neural radiance fields
Understanding neural radiance fields
 
TransNeRF
TransNeRFTransNeRF
TransNeRF
 
Single Sample Soft Shadows Using Depth Maps
Single Sample Soft Shadows Using Depth MapsSingle Sample Soft Shadows Using Depth Maps
Single Sample Soft Shadows Using Depth Maps
 
Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)
 
NVIDIA effects GDC09
NVIDIA effects GDC09NVIDIA effects GDC09
NVIDIA effects GDC09
 
Non-Planar Projections (GRAPP 2008)
Non-Planar Projections (GRAPP 2008)Non-Planar Projections (GRAPP 2008)
Non-Planar Projections (GRAPP 2008)
 

Dernier

Dernier (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Advanced Lighting for Interactive Applications