SlideShare une entreprise Scribd logo
1  sur  33
Massive Point Light Soft Shadows
Wolfgang Engel
Confetti Special Effects Inc.
September 14th, 2010
Confetti Special Effects
• Think-Tank for advanced real-time graphics
research
• Targeting video game and movie industry
• Website: (click on “Like” on this page )
http://www.facebook.com/pages/Confetti-Special-Effects-Inc/159613387880?v=wall
Agenda
• Motivation
• Basics of Soft Shadows
• Point Light Soft Shadow Rendering
Architecture
• Min-Z Map
• Collect Shadow Data in Screen-Space
• Screen-Space Anisotropic Filtering
Motivation
• We can render thousands of point lights
• We need at least dozens of point light soft
shadows and many more regular point light
shadows
• Fundamental for future development of more
complex light and shadow effects like Global
Illumination with a Global Occlusion / Shadow
term
Image courtesy of Randy Fernando [Fernando]
Basics of Soft Shadows
• Terminology
Basics of Soft Shadows
• PCSS searches red region for blockers
– Blocker is defined by being closer to light than receiving
point
– Averages depth values of blockers
– Averaged depth value used for penumbra size estimation
Basics of Soft Shadows
• Blocker search
// is it a blocker?
if (shadMapDepth < receiver)
{
blockerSum += shadMapDepth;
blockerCount++;
foundBlocker = 1;
}
…
// return average depth of the blockers
result = blockerSum / blockerCount;
Basics of Soft Shadows
• How to calculate the scale factor for the penumbra
• dBlocker – the result of the blocker search
• dReceiver – the depth of the pixel that is currently rendered
• wlight – the light size
Basics of Soft Shadows
Rendering Architecture
For Point Light Screen-Space soft shadows we
are going to change mainly two things:
1. Replace blocker search with a minimum Z-
map or dilated shadow map [Gumbau]
-> Blocker search is expensive
2. Anisotropic Screen-Space Filter Kernel
instead of Light-Space filter kernel
-> Screen-Space is less expensive
The algorithm in steps:
1. Calculate the cube shadow map
2. Generate min Z map [Gumbau]
3. Blend the “unfiltered” exponential shadow map data of all
cube maps into a screen-space shadow map
4. Based on each min Z map, calculate
a. The x and y offset values for the filter kernel based on
• Adjustment based on distance from camera
• Penumbra size [Fernando]
• Anisotropic kernel adjustment [Geusebroek]
b. Early out value (optimization) [Gumbau]
-> store the end result in a screen-space texture
5. Apply a screen-space anisotropic Gaussian filter kernel
based on 4.
Rendering Architecture
Min-Z Map
• Blocker search
• is used to determine the distance of the shadow
blockers -> dBlocker
• this is used to determine the penumbra width
• Minimum Z map represents the minimum Z values
== closest to the lights of the whole scene
~ kind of like blocker data
Min-Z Map
• Generated from the shadow map
• Into a lower res render target == coarse shadow map
== one pixel represents an area of the orig. shadow
map
-> runs only CoarseMapsizeX * CoarseMapsizeY times
-> fast
• 2 pass filter kernel that returns the minimum Z
values of its area in light space
Min-Z Map
• Issue: maximum size of penumbra restricted by size
of filter kernel
-> no way to figure out max size of the penumbra
-> sensible user defined constant value that scales up
filter kernel
• too high -> artefacts
• too low -> loose of softeness
• In other words: filter kernel is determined by a
• value representing the light size
• + value that is the magic user defined constant
Min-Z Map
• Advantage of Min-Z map approach
• much faster
• … therefore allows soft cube shadow maps
• Disadvantage: min-Z value not only from
blockers but for the whole lit scene
-> min-Z aliasing
Collect Shadow Data in Screen-Space
Cube map == exponential shadow map [Salvi]
float depth = tex2D(ShadowSampler, pos.xy).x;
shadow = saturate(2.0 - exp((pos.z - depth) * k));
• Approximate step function (z-d> 0) by
exp(k*(z-d)) = exp(k*z) * exp(-k*d)
Good overview on the latest development in [Bavoil]
• All the shadow data is just blended via
BLEND_ADD into a screen-space texture
• This texture can be called shadow collector or
shadow mask
Collect Shadow Data in Screen-Space
Screen-Space Anisotropic Filter Kernel
• Why a screen-space filter kernel?
• In light space we filter per shadow map
• In screen-space we filter only once for all
shadow maps
-> many light sources
-> advantage
Screen-Space Anisotropic Filter Kernel
• What we need to do:
• Determine the filter kernel offset values
that scale the filter kernel
• Write “offset” values for all shadow maps
into a screen-space render target
• … the Gauss filter will read those values
later from there
Screen-Space Anisotropic Filter Kernel
• What are the values required for the Gauss filter?
1. The x and y offset values for the filter
kernel are based on
a. Adjustment based on distance from
camera
b. Penumbra size & Light size[Fernando]
c. Anisotropic kernel adjustment
[Geusebroek]
2. Early out value (optimization) [Gumbau]
• … store those values in a 16:16 fp render target
or calculate them on the fly while filtering
Distance to the Camera
• Screen-space filter kernel is getting bigger with
increasing distance because of the projection
-> decrease kernel size with with increasing
distance
• Simple way to do this is 1.0 / (distance2 * bias)
~ light attenuation
• This requires a linear depth value in camera space [Gillham]:
float depthLin= (-NearClip * Q) / (Depth - Q);
Q = FarClip / (FarClip – NearClip)
Depth = value from depth buffer
• Source code:
// scale based on distance to the viewer
sampleStep.xy = TexelSize.zw * sqrt(1.0f / ((depthLin.xx * depthLin.xx) * bias));
Penumbra Size
• To calculate the Penumbra, [Fernando]
suggested the following equation
• We use as is, just modified by the “distance to
camera” scaling value
Anisotropic Filter Kernel Adjustment
• Anisotropic filter kernel: round filter kernel
projected into ellipse following the orientation
of the geometry [Geusebroek]
-> need to determine the shape and
orientation of this ellipse
float Aniso = saturate(sqrt(dot( viewVec, normal )));
Screen-Space Anisotropic Filter Kernel
• Screen-space challenges
• Filter kernel can smear values into the penumbra around
corners of geometry
• Compare Z value of pixel with Z value of shadow map tap
bool isValidSample = bool( abs(sampleDepth - d) < errDepth );
if (isValidSample && isShadow)
{
// the sample is considered valid
sumWeightsOK += weights[i+1]; // accumulate valid weights
Shadow += sampleL0.x * weights[i+1]; // accumulate weighted shadow value
}
Screen-Space Anisotropic Filter Kernel
• Screen-space challenges
• “Light in a box” or occlusion of shadow data in
general -> should not affect Gauss filter -> need to
deal with occlusion or ignore it (game specific)
• Overlapping shadows in screen-space
-> starts with the philosophical question: what
kind of entity are shadows?
Tips & Tricks
• Seriously! Who needs 64 Point light shadows
perceptually correct on screen 
• switch off when the lights are fast
• Far away
• .. . or in all other cases you can think off
• How to render shadow data into a cube map
-> fill up a texture array; then type cast to
cube maps
• Try Dual-Paraboloid Shadow Maps … might be faster
with DX10 / 11 … I didn’t try so far
Massive Soft Point Light Shadows
16 Point Light Soft Shadows filtered in screen-space
Massive Soft Point Light Shadows
32 Point Light Soft Shadows filtered in screen-space
Massive Soft Point Light Shadows
64 Point Light Soft Shadows filtered in screen-space
Acknowledgements
• Jesus Gumbau
• Peter Santoki
• Yue Yu
• Timothy Martin
• Carlos Dominguez
Confetti Special Effects
• Is looking for
– Investors
– Contract work
– Offers support to young researchers at
Universities that are interested in game related
real-time research
Thank you
wolf@conffx.com
References
• [Bavoil] Louis Bavoil, “Advanced Soft Shadow Mapping Techniques”
http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMappin
g.pdf
• [Fernando] Randy Fernando, “Percentage-Closer Soft Shadows”, SIGGRAPH 2005
• [Forsyth] Tom Forsyth, “Making Shadow Buffers Robust Using Multiple Dynamic Frustums”,
ShaderX4, pp. 331 – 345
• [Geusebroek] Jan-Mark Geusebroek, Arnold W. M. Smeulders, J. van de Weijer, “Fast
anisotropic Gauss filtering”, IEEE Transactions on Image Processing, Volume 12 (8), page 938-
943, 2003
• [Gilham] David Gilham, "Real-Time Depth-of-Field Implemented with a Post-Processing only
Technique", ShaderX5: Advanced Rendering, Charles River Media / Thomson, pp 163 -
175, ISBN 1-58450-499-4
• [Gumbau] Jesus Gumbau, Miguel Chover, and Mateu Sbert, “Screen-Space Soft Shadows”,
GPU Pro, pp. 477 - 490
• [Waliszewski] Arkadiusz Waliszewski, “Floating-point Cube Maps”, ShaderX2 – Shader
Programming Tips and Tricks with DirectX9, Wordware Inc., pp. 319 – 323.
http://www.realtimerendering.com/blog/shaderx2-books-available-for-free-download/

Contenu connexe

Tendances

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 FallenBenjamin Glatzel
 
A Bizarre Way to do Real-Time Lighting
A Bizarre Way to do Real-Time LightingA Bizarre Way to do Real-Time Lighting
A Bizarre Way to do Real-Time LightingSteven Tovey
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John HableNaughty Dog
 
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 2016Graham Wihlidal
 
Physically Based and Unified Volumetric Rendering in Frostbite
Physically Based and Unified Volumetric Rendering in FrostbitePhysically Based and Unified Volumetric Rendering in Frostbite
Physically Based and Unified Volumetric Rendering in FrostbiteElectronic Arts / DICE
 
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 IlluminationWolfgang Engel
 
Lighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow FallLighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow FallGuerrilla
 
Hable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr LightingHable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr Lightingozlael ozlael
 
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 DawnGuerrilla
 
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)Tiago Sousa
 
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 666Tiago Sousa
 
「原神」におけるコンソールプラットフォーム開発
「原神」におけるコンソールプラットフォーム開発「原神」におけるコンソールプラットフォーム開発
「原神」におけるコンソールプラットフォーム開発Unity Technologies Japan K.K.
 
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect AndromedaElectronic Arts / DICE
 
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...Unity Technologies
 
Past, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesPast, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesColin Barré-Brisebois
 
SIGGRAPH 2010 Water Flow in Portal 2
SIGGRAPH 2010 Water Flow in Portal 2SIGGRAPH 2010 Water Flow in Portal 2
SIGGRAPH 2010 Water Flow in Portal 2Alex Vlachos
 

Tendances (20)

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
 
A Bizarre Way to do Real-Time Lighting
A Bizarre Way to do Real-Time LightingA Bizarre Way to do Real-Time Lighting
A Bizarre Way to do Real-Time Lighting
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John Hable
 
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
 
Lighting you up in Battlefield 3
Lighting you up in Battlefield 3Lighting you up in Battlefield 3
Lighting you up in Battlefield 3
 
Lighting the City of Glass
Lighting the City of GlassLighting the City of Glass
Lighting the City of Glass
 
Physically Based and Unified Volumetric Rendering in Frostbite
Physically Based and Unified Volumetric Rendering in FrostbitePhysically Based and Unified Volumetric Rendering in Frostbite
Physically Based and Unified Volumetric Rendering in Frostbite
 
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
 
Lighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow FallLighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow Fall
 
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
 
Hable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr LightingHable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr Lighting
 
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
 
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)
 
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
 
「原神」におけるコンソールプラットフォーム開発
「原神」におけるコンソールプラットフォーム開発「原神」におけるコンソールプラットフォーム開発
「原神」におけるコンソールプラットフォーム開発
 
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
 
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
 
Stochastic Screen-Space Reflections
Stochastic Screen-Space ReflectionsStochastic Screen-Space Reflections
Stochastic Screen-Space Reflections
 
Past, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesPast, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in Games
 
SIGGRAPH 2010 Water Flow in Portal 2
SIGGRAPH 2010 Water Flow in Portal 2SIGGRAPH 2010 Water Flow in Portal 2
SIGGRAPH 2010 Water Flow in Portal 2
 

En vedette

CREATIVE PROCESS IN SEVEN STEPS - METAPHOR OF CREATION
CREATIVE PROCESS IN SEVEN STEPS - METAPHOR OF CREATIONCREATIVE PROCESS IN SEVEN STEPS - METAPHOR OF CREATION
CREATIVE PROCESS IN SEVEN STEPS - METAPHOR OF CREATIONalbertorivas2014
 
Mark Jenkins Street art, Tape Sculpture
Mark Jenkins Street art, Tape SculptureMark Jenkins Street art, Tape Sculpture
Mark Jenkins Street art, Tape SculptureMarta Lage de la Rosa
 
Ppt slide presentation for LIght Art
Ppt slide presentation for LIght ArtPpt slide presentation for LIght Art
Ppt slide presentation for LIght ArtJennifer Kim
 
Pinhole cameraobscura
Pinhole cameraobscuraPinhole cameraobscura
Pinhole cameraobscurafavalora
 
Christmas Lighs (part 2)
Christmas Lighs (part 2)Christmas Lighs (part 2)
Christmas Lighs (part 2)Nubia **
 
Camera obscura pinhole
Camera obscura pinholeCamera obscura pinhole
Camera obscura pinholeINS Tremp
 

En vedette (9)

CREATIVE PROCESS IN SEVEN STEPS - METAPHOR OF CREATION
CREATIVE PROCESS IN SEVEN STEPS - METAPHOR OF CREATIONCREATIVE PROCESS IN SEVEN STEPS - METAPHOR OF CREATION
CREATIVE PROCESS IN SEVEN STEPS - METAPHOR OF CREATION
 
Mark Jenkins Street art, Tape Sculpture
Mark Jenkins Street art, Tape SculptureMark Jenkins Street art, Tape Sculpture
Mark Jenkins Street art, Tape Sculpture
 
Ppt slide presentation for LIght Art
Ppt slide presentation for LIght ArtPpt slide presentation for LIght Art
Ppt slide presentation for LIght Art
 
Pinhole cameraobscura
Pinhole cameraobscuraPinhole cameraobscura
Pinhole cameraobscura
 
Christmas Lighs (part 2)
Christmas Lighs (part 2)Christmas Lighs (part 2)
Christmas Lighs (part 2)
 
Camera obscura pinhole
Camera obscura pinholeCamera obscura pinhole
Camera obscura pinhole
 
Artistas de la luz
Artistas de la luzArtistas de la luz
Artistas de la luz
 
Lights and shadows
Lights and shadowsLights and shadows
Lights and shadows
 
Light and Shadow
Light and ShadowLight and Shadow
Light and Shadow
 

Similaire à Massive Soft Point Light Shadows in Screen Space

hidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithmhidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithmrajivagarwal23dei
 
A new Post-Processing Pipeline
A new Post-Processing PipelineA new Post-Processing Pipeline
A new Post-Processing PipelineWolfgang Engel
 
A modern Post-Processing Pipeline
A modern Post-Processing PipelineA modern Post-Processing Pipeline
A modern Post-Processing PipelineWolfgang Engel
 
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 Mapsstefan_b
 
Advanced Lighting for Interactive Applications
Advanced Lighting for Interactive ApplicationsAdvanced Lighting for Interactive Applications
Advanced Lighting for Interactive Applicationsstefan_b
 
From Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGLFrom Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGLFITC
 
Shadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive ApplicationsShadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive Applicationsstefan_b
 
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
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologyTiago Sousa
 
Technologies Used In Graphics Rendering
Technologies Used In Graphics RenderingTechnologies Used In Graphics Rendering
Technologies Used In Graphics RenderingBhupinder Singh
 
Analysis of KinectFusion
Analysis of KinectFusionAnalysis of KinectFusion
Analysis of KinectFusionDong-Won Shin
 
Real-time Shadowing Techniques: Shadow Volumes
Real-time Shadowing Techniques: Shadow VolumesReal-time Shadowing Techniques: Shadow Volumes
Real-time Shadowing Techniques: Shadow VolumesMark Kilgard
 
Understanding neural radiance fields
Understanding neural radiance fieldsUnderstanding neural radiance fields
Understanding neural radiance fieldsVarun Bhaseen
 
Introdution to astro photography
Introdution to astro photographyIntrodution to astro photography
Introdution to astro photographymarkcasazza
 
Rendering AAA-Quality Characters of Project A1
Rendering AAA-Quality Characters of Project A1Rendering AAA-Quality Characters of Project A1
Rendering AAA-Quality Characters of Project A1Ki Hyunwoo
 
visible surface detection in 3D objects for viewing
visible surface detection in 3D objects for viewingvisible surface detection in 3D objects for viewing
visible surface detection in 3D objects for viewingsrinivasan779644
 
The Technology Behind the DirectX 11 Unreal Engine"Samaritan" Demo
The Technology Behind the DirectX 11 Unreal Engine"Samaritan" DemoThe Technology Behind the DirectX 11 Unreal Engine"Samaritan" Demo
The Technology Behind the DirectX 11 Unreal Engine"Samaritan" Demodrandom
 

Similaire à Massive Soft Point Light Shadows in Screen Space (20)

november29.ppt
november29.pptnovember29.ppt
november29.ppt
 
hidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithmhidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithm
 
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
 
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
 
Advanced Lighting for Interactive Applications
Advanced Lighting for Interactive ApplicationsAdvanced Lighting for Interactive Applications
Advanced Lighting for Interactive Applications
 
From Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGLFrom Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGL
 
Shadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive ApplicationsShadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive Applications
 
Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)Crysis Next-Gen Effects (GDC 2008)
Crysis Next-Gen Effects (GDC 2008)
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
 
Technologies Used In Graphics Rendering
Technologies Used In Graphics RenderingTechnologies Used In Graphics Rendering
Technologies Used In Graphics Rendering
 
Analysis of KinectFusion
Analysis of KinectFusionAnalysis of KinectFusion
Analysis of KinectFusion
 
Depth Buffer Method
Depth Buffer MethodDepth Buffer Method
Depth Buffer Method
 
Real-time Shadowing Techniques: Shadow Volumes
Real-time Shadowing Techniques: Shadow VolumesReal-time Shadowing Techniques: Shadow Volumes
Real-time Shadowing Techniques: Shadow Volumes
 
Understanding neural radiance fields
Understanding neural radiance fieldsUnderstanding neural radiance fields
Understanding neural radiance fields
 
OpenGL for 2015
OpenGL for 2015OpenGL for 2015
OpenGL for 2015
 
Introdution to astro photography
Introdution to astro photographyIntrodution to astro photography
Introdution to astro photography
 
Rendering AAA-Quality Characters of Project A1
Rendering AAA-Quality Characters of Project A1Rendering AAA-Quality Characters of Project A1
Rendering AAA-Quality Characters of Project A1
 
visible surface detection in 3D objects for viewing
visible surface detection in 3D objects for viewingvisible surface detection in 3D objects for viewing
visible surface detection in 3D objects for viewing
 
The Technology Behind the DirectX 11 Unreal Engine"Samaritan" Demo
The Technology Behind the DirectX 11 Unreal Engine"Samaritan" DemoThe Technology Behind the DirectX 11 Unreal Engine"Samaritan" Demo
The Technology Behind the DirectX 11 Unreal Engine"Samaritan" Demo
 

Plus de Wolfgang Engel

Paris Master Class 2011 - 06 Gpu Particle System
Paris Master Class 2011 - 06 Gpu Particle SystemParis Master Class 2011 - 06 Gpu Particle System
Paris Master Class 2011 - 06 Gpu Particle SystemWolfgang Engel
 
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 PipelineWolfgang Engel
 
Paris Master Class 2011 - 03 Order Independent Transparency
Paris Master Class 2011 - 03 Order Independent TransparencyParis Master Class 2011 - 03 Order Independent Transparency
Paris Master Class 2011 - 03 Order Independent TransparencyWolfgang Engel
 
Paris Master Class 2011 - 02 Screen Space Material System
Paris Master Class 2011 - 02 Screen Space Material SystemParis Master Class 2011 - 02 Screen Space Material System
Paris Master Class 2011 - 02 Screen Space Material SystemWolfgang Engel
 
Paris Master Class 2011 - 01 Deferred Lighting, MSAA
Paris Master Class 2011 - 01 Deferred Lighting, MSAAParis Master Class 2011 - 01 Deferred Lighting, MSAA
Paris Master Class 2011 - 01 Deferred Lighting, MSAAWolfgang Engel
 
Paris Master Class 2011 - 00 Paris Master Class
Paris Master Class 2011 - 00 Paris Master ClassParis Master Class 2011 - 00 Paris Master Class
Paris Master Class 2011 - 00 Paris Master ClassWolfgang Engel
 

Plus de Wolfgang Engel (8)

Light and Shadows
Light and ShadowsLight and Shadows
Light and Shadows
 
Paris Master Class 2011 - 06 Gpu Particle System
Paris Master Class 2011 - 06 Gpu Particle SystemParis Master Class 2011 - 06 Gpu Particle System
Paris Master Class 2011 - 06 Gpu Particle System
 
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
 
Paris Master Class 2011 - 03 Order Independent Transparency
Paris Master Class 2011 - 03 Order Independent TransparencyParis Master Class 2011 - 03 Order Independent Transparency
Paris Master Class 2011 - 03 Order Independent Transparency
 
Paris Master Class 2011 - 02 Screen Space Material System
Paris Master Class 2011 - 02 Screen Space Material SystemParis Master Class 2011 - 02 Screen Space Material System
Paris Master Class 2011 - 02 Screen Space Material System
 
Paris Master Class 2011 - 01 Deferred Lighting, MSAA
Paris Master Class 2011 - 01 Deferred Lighting, MSAAParis Master Class 2011 - 01 Deferred Lighting, MSAA
Paris Master Class 2011 - 01 Deferred Lighting, MSAA
 
Paris Master Class 2011 - 00 Paris Master Class
Paris Master Class 2011 - 00 Paris Master ClassParis Master Class 2011 - 00 Paris Master Class
Paris Master Class 2011 - 00 Paris Master Class
 
Hair in Tomb Raider
Hair in Tomb RaiderHair in Tomb Raider
Hair in Tomb Raider
 

Dernier

Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptJasonTagapanGulla
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 

Dernier (20)

Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.ppt
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 

Massive Soft Point Light Shadows in Screen Space

  • 1. Massive Point Light Soft Shadows Wolfgang Engel Confetti Special Effects Inc. September 14th, 2010
  • 2. Confetti Special Effects • Think-Tank for advanced real-time graphics research • Targeting video game and movie industry • Website: (click on “Like” on this page ) http://www.facebook.com/pages/Confetti-Special-Effects-Inc/159613387880?v=wall
  • 3. Agenda • Motivation • Basics of Soft Shadows • Point Light Soft Shadow Rendering Architecture • Min-Z Map • Collect Shadow Data in Screen-Space • Screen-Space Anisotropic Filtering
  • 4. Motivation • We can render thousands of point lights • We need at least dozens of point light soft shadows and many more regular point light shadows • Fundamental for future development of more complex light and shadow effects like Global Illumination with a Global Occlusion / Shadow term
  • 5. Image courtesy of Randy Fernando [Fernando] Basics of Soft Shadows
  • 7. • PCSS searches red region for blockers – Blocker is defined by being closer to light than receiving point – Averages depth values of blockers – Averaged depth value used for penumbra size estimation Basics of Soft Shadows
  • 8. • Blocker search // is it a blocker? if (shadMapDepth < receiver) { blockerSum += shadMapDepth; blockerCount++; foundBlocker = 1; } … // return average depth of the blockers result = blockerSum / blockerCount; Basics of Soft Shadows
  • 9. • How to calculate the scale factor for the penumbra • dBlocker – the result of the blocker search • dReceiver – the depth of the pixel that is currently rendered • wlight – the light size Basics of Soft Shadows
  • 10. Rendering Architecture For Point Light Screen-Space soft shadows we are going to change mainly two things: 1. Replace blocker search with a minimum Z- map or dilated shadow map [Gumbau] -> Blocker search is expensive 2. Anisotropic Screen-Space Filter Kernel instead of Light-Space filter kernel -> Screen-Space is less expensive
  • 11. The algorithm in steps: 1. Calculate the cube shadow map 2. Generate min Z map [Gumbau] 3. Blend the “unfiltered” exponential shadow map data of all cube maps into a screen-space shadow map 4. Based on each min Z map, calculate a. The x and y offset values for the filter kernel based on • Adjustment based on distance from camera • Penumbra size [Fernando] • Anisotropic kernel adjustment [Geusebroek] b. Early out value (optimization) [Gumbau] -> store the end result in a screen-space texture 5. Apply a screen-space anisotropic Gaussian filter kernel based on 4. Rendering Architecture
  • 12. Min-Z Map • Blocker search • is used to determine the distance of the shadow blockers -> dBlocker • this is used to determine the penumbra width • Minimum Z map represents the minimum Z values == closest to the lights of the whole scene ~ kind of like blocker data
  • 13. Min-Z Map • Generated from the shadow map • Into a lower res render target == coarse shadow map == one pixel represents an area of the orig. shadow map -> runs only CoarseMapsizeX * CoarseMapsizeY times -> fast • 2 pass filter kernel that returns the minimum Z values of its area in light space
  • 14. Min-Z Map • Issue: maximum size of penumbra restricted by size of filter kernel -> no way to figure out max size of the penumbra -> sensible user defined constant value that scales up filter kernel • too high -> artefacts • too low -> loose of softeness • In other words: filter kernel is determined by a • value representing the light size • + value that is the magic user defined constant
  • 15. Min-Z Map • Advantage of Min-Z map approach • much faster • … therefore allows soft cube shadow maps • Disadvantage: min-Z value not only from blockers but for the whole lit scene -> min-Z aliasing
  • 16. Collect Shadow Data in Screen-Space Cube map == exponential shadow map [Salvi] float depth = tex2D(ShadowSampler, pos.xy).x; shadow = saturate(2.0 - exp((pos.z - depth) * k)); • Approximate step function (z-d> 0) by exp(k*(z-d)) = exp(k*z) * exp(-k*d) Good overview on the latest development in [Bavoil]
  • 17. • All the shadow data is just blended via BLEND_ADD into a screen-space texture • This texture can be called shadow collector or shadow mask Collect Shadow Data in Screen-Space
  • 18. Screen-Space Anisotropic Filter Kernel • Why a screen-space filter kernel? • In light space we filter per shadow map • In screen-space we filter only once for all shadow maps -> many light sources -> advantage
  • 19. Screen-Space Anisotropic Filter Kernel • What we need to do: • Determine the filter kernel offset values that scale the filter kernel • Write “offset” values for all shadow maps into a screen-space render target • … the Gauss filter will read those values later from there
  • 20. Screen-Space Anisotropic Filter Kernel • What are the values required for the Gauss filter? 1. The x and y offset values for the filter kernel are based on a. Adjustment based on distance from camera b. Penumbra size & Light size[Fernando] c. Anisotropic kernel adjustment [Geusebroek] 2. Early out value (optimization) [Gumbau] • … store those values in a 16:16 fp render target or calculate them on the fly while filtering
  • 21. Distance to the Camera • Screen-space filter kernel is getting bigger with increasing distance because of the projection -> decrease kernel size with with increasing distance • Simple way to do this is 1.0 / (distance2 * bias) ~ light attenuation • This requires a linear depth value in camera space [Gillham]: float depthLin= (-NearClip * Q) / (Depth - Q); Q = FarClip / (FarClip – NearClip) Depth = value from depth buffer • Source code: // scale based on distance to the viewer sampleStep.xy = TexelSize.zw * sqrt(1.0f / ((depthLin.xx * depthLin.xx) * bias));
  • 22. Penumbra Size • To calculate the Penumbra, [Fernando] suggested the following equation • We use as is, just modified by the “distance to camera” scaling value
  • 23. Anisotropic Filter Kernel Adjustment • Anisotropic filter kernel: round filter kernel projected into ellipse following the orientation of the geometry [Geusebroek] -> need to determine the shape and orientation of this ellipse float Aniso = saturate(sqrt(dot( viewVec, normal )));
  • 24. Screen-Space Anisotropic Filter Kernel • Screen-space challenges • Filter kernel can smear values into the penumbra around corners of geometry • Compare Z value of pixel with Z value of shadow map tap bool isValidSample = bool( abs(sampleDepth - d) < errDepth ); if (isValidSample && isShadow) { // the sample is considered valid sumWeightsOK += weights[i+1]; // accumulate valid weights Shadow += sampleL0.x * weights[i+1]; // accumulate weighted shadow value }
  • 25. Screen-Space Anisotropic Filter Kernel • Screen-space challenges • “Light in a box” or occlusion of shadow data in general -> should not affect Gauss filter -> need to deal with occlusion or ignore it (game specific) • Overlapping shadows in screen-space -> starts with the philosophical question: what kind of entity are shadows?
  • 26. Tips & Tricks • Seriously! Who needs 64 Point light shadows perceptually correct on screen  • switch off when the lights are fast • Far away • .. . or in all other cases you can think off • How to render shadow data into a cube map -> fill up a texture array; then type cast to cube maps • Try Dual-Paraboloid Shadow Maps … might be faster with DX10 / 11 … I didn’t try so far
  • 27. Massive Soft Point Light Shadows 16 Point Light Soft Shadows filtered in screen-space
  • 28. Massive Soft Point Light Shadows 32 Point Light Soft Shadows filtered in screen-space
  • 29. Massive Soft Point Light Shadows 64 Point Light Soft Shadows filtered in screen-space
  • 30. Acknowledgements • Jesus Gumbau • Peter Santoki • Yue Yu • Timothy Martin • Carlos Dominguez
  • 31. Confetti Special Effects • Is looking for – Investors – Contract work – Offers support to young researchers at Universities that are interested in game related real-time research
  • 33. References • [Bavoil] Louis Bavoil, “Advanced Soft Shadow Mapping Techniques” http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMappin g.pdf • [Fernando] Randy Fernando, “Percentage-Closer Soft Shadows”, SIGGRAPH 2005 • [Forsyth] Tom Forsyth, “Making Shadow Buffers Robust Using Multiple Dynamic Frustums”, ShaderX4, pp. 331 – 345 • [Geusebroek] Jan-Mark Geusebroek, Arnold W. M. Smeulders, J. van de Weijer, “Fast anisotropic Gauss filtering”, IEEE Transactions on Image Processing, Volume 12 (8), page 938- 943, 2003 • [Gilham] David Gilham, "Real-Time Depth-of-Field Implemented with a Post-Processing only Technique", ShaderX5: Advanced Rendering, Charles River Media / Thomson, pp 163 - 175, ISBN 1-58450-499-4 • [Gumbau] Jesus Gumbau, Miguel Chover, and Mateu Sbert, “Screen-Space Soft Shadows”, GPU Pro, pp. 477 - 490 • [Waliszewski] Arkadiusz Waliszewski, “Floating-point Cube Maps”, ShaderX2 – Shader Programming Tips and Tricks with DirectX9, Wordware Inc., pp. 319 – 323. http://www.realtimerendering.com/blog/shaderx2-books-available-for-free-download/