SlideShare a Scribd company logo
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/

More Related Content

PDF
Graphics Gems from CryENGINE 3 (Siggraph 2013)
PPTX
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
PPTX
A Scalable Real-Time Many-Shadowed-Light Rendering System
PPT
A Bit More Deferred Cry Engine3
PDF
輪読発表資料: Efficient Virtual Shadow Maps for Many Lights
PPTX
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
PPTX
Optimizing the Graphics Pipeline with Compute, GDC 2016
KEY
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...
Graphics Gems from CryENGINE 3 (Siggraph 2013)
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Scalable Real-Time Many-Shadowed-Light Rendering System
A Bit More Deferred Cry Engine3
輪読発表資料: Efficient Virtual Shadow Maps for Many Lights
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Optimizing the Graphics Pipeline with Compute, GDC 2016
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...

What's hot (20)

PPTX
Frostbite on Mobile
PDF
Bindless Deferred Decals in The Surge 2
PPT
Secrets of CryENGINE 3 Graphics Technology
PDF
Siggraph2016 - The Devil is in the Details: idTech 666
PDF
Killzone Shadow Fall Demo Postmortem
PDF
Screen Space Reflections in The Surge
PPTX
Rendering Technologies from Crysis 3 (GDC 2013)
PPTX
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
PPTX
Moving Frostbite to Physically Based Rendering
PPT
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
PPTX
Deferred shading
PPT
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
PPTX
Parallel Futures of a Game Engine
PDF
Advanced Scenegraph Rendering Pipeline
PPTX
The Rendering Pipeline - Challenges & Next Steps
PPT
Crysis Next-Gen Effects (GDC 2008)
PDF
Rendering Tech of Space Marine
PDF
OpenGL 4.4 - Scene Rendering Techniques
PPTX
Lighting the City of Glass
PDF
Volumetric Lighting for Many Lights in Lords of the Fallen
Frostbite on Mobile
Bindless Deferred Decals in The Surge 2
Secrets of CryENGINE 3 Graphics Technology
Siggraph2016 - The Devil is in the Details: idTech 666
Killzone Shadow Fall Demo Postmortem
Screen Space Reflections in The Surge
Rendering Technologies from Crysis 3 (GDC 2013)
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Moving Frostbite to Physically Based Rendering
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Deferred shading
Terrain Rendering in Frostbite using Procedural Shader Splatting (Siggraph 2007)
Parallel Futures of a Game Engine
Advanced Scenegraph Rendering Pipeline
The Rendering Pipeline - Challenges & Next Steps
Crysis Next-Gen Effects (GDC 2008)
Rendering Tech of Space Marine
OpenGL 4.4 - Scene Rendering Techniques
Lighting the City of Glass
Volumetric Lighting for Many Lights in Lords of the Fallen
Ad

Viewers also liked (10)

PPTX
CREATIVE PROCESS IN SEVEN STEPS - METAPHOR OF CREATION
PDF
Mark Jenkins Street art, Tape Sculpture
PDF
Ppt slide presentation for LIght Art
PPT
Pinhole cameraobscura
PPSX
Christmas Lighs (part 2)
PDF
Camera obscura pinhole
PDF
Artistas de la luz
PPTX
Lights and shadows
PPT
The Unique Lighting of Mirror's Edge
PPTX
Light and Shadow
CREATIVE PROCESS IN SEVEN STEPS - METAPHOR OF CREATION
Mark Jenkins Street art, Tape Sculpture
Ppt slide presentation for LIght Art
Pinhole cameraobscura
Christmas Lighs (part 2)
Camera obscura pinhole
Artistas de la luz
Lights and shadows
The Unique Lighting of Mirror's Edge
Light and Shadow
Ad

Similar to Massive Point Light Soft Shadows (20)

PPT
Single Sample Soft Shadows Using Depth Maps
PPT
Advanced Lighting for Interactive Applications
PPT
Light and Shadows
PPT
Shadow Mapping with Today's OpenGL Hardware
PPT
Paris Master Class 2011 - 04 Shadow Maps
PPT
Paris Master Class 2011 - 07 Dynamic Global Illumination
PPTX
The Rendering Technology of Killzone 2
PPT
Shadow Techniques for Real-Time and Interactive Applications
PPTX
A Bizarre Way to do Real-Time Lighting
PPT
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
PDF
Taking Killzone Shadow Fall Image Quality Into The Next Generation
PPTX
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
PDF
Deferred shading
PPT
Paris Master Class 2011 - 01 Deferred Lighting, MSAA
PPT
Praseed Pai
PPT
Extended Light Maps
PPT
Deferred Lighting and Post Processing on PLAYSTATION®3
PPT
Soft Shadow Maps for Linear Lights
PPT
CS 354 Shadows
PDF
Deferred Rendering in Killzone 2
Single Sample Soft Shadows Using Depth Maps
Advanced Lighting for Interactive Applications
Light and Shadows
Shadow Mapping with Today's OpenGL Hardware
Paris Master Class 2011 - 04 Shadow Maps
Paris Master Class 2011 - 07 Dynamic Global Illumination
The Rendering Technology of Killzone 2
Shadow Techniques for Real-Time and Interactive Applications
A Bizarre Way to do Real-Time Lighting
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
Taking Killzone Shadow Fall Image Quality Into The Next Generation
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
Deferred shading
Paris Master Class 2011 - 01 Deferred Lighting, MSAA
Praseed Pai
Extended Light Maps
Deferred Lighting and Post Processing on PLAYSTATION®3
Soft Shadow Maps for Linear Lights
CS 354 Shadows
Deferred Rendering in Killzone 2

More from Wolfgang Engel (9)

PPTX
A modern Post-Processing Pipeline
PPTX
Triangle Visibility buffer
PPT
Paris Master Class 2011 - 06 Gpu Particle System
PPT
Paris Master Class 2011 - 05 Post-Processing Pipeline
PPT
Paris Master Class 2011 - 03 Order Independent Transparency
PPT
Paris Master Class 2011 - 02 Screen Space Material System
PPT
Paris Master Class 2011 - 00 Paris Master Class
PPTX
A new Post-Processing Pipeline
PPTX
Hair in Tomb Raider
A modern Post-Processing Pipeline
Triangle Visibility buffer
Paris Master Class 2011 - 06 Gpu Particle System
Paris Master Class 2011 - 05 Post-Processing Pipeline
Paris Master Class 2011 - 03 Order Independent Transparency
Paris Master Class 2011 - 02 Screen Space Material System
Paris Master Class 2011 - 00 Paris Master Class
A new Post-Processing Pipeline
Hair in Tomb Raider

Recently uploaded (20)

PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
PPTX
Sustainable Sites - Green Building Construction
DOCX
573137875-Attendance-Management-System-original
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
composite construction of structures.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Internet of Things (IOT) - A guide to understanding
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
bas. eng. economics group 4 presentation 1.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Sustainable Sites - Green Building Construction
573137875-Attendance-Management-System-original
Arduino robotics embedded978-1-4302-3184-4.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Lesson 3_Tessellation.pptx finite Mathematics
Lecture Notes Electrical Wiring System Components
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Structs to JSON How Go Powers REST APIs.pdf
composite construction of structures.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Model Code of Practice - Construction Work - 21102022 .pdf

Massive Point Light Soft Shadows

  • 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/