Fast Cascade VSM By Zhang Jian.

Slides:



Advertisements
Similar presentations
Accelerating Real-Time Shading with Reverse Reprojection Caching Diego Nehab 1 Pedro V. Sander 2 Jason Lawrence 3 Natalya Tatarchuk 4 John R. Isidoro 4.
Advertisements

Exploration of advanced lighting and shading techniques
An Optimized Soft Shadow Volume Algorithm with Real-Time Performance Ulf Assarsson 1, Michael Dougherty 2, Michael Mounier 2, and Tomas Akenine-Möller.
Exploration of bump, parallax, relief and displacement mapping
Game Programming 09 OGRE3D Lighting/shadow in Action
RealityEngine Graphics Kurt Akeley Silicon Graphics Computer Systems.
SDSM SAMPLE DISTRIBUTION SHADOW MAPS The Evolution Of PSSM.
The Art and Technology Behind Bioshock’s Special Effects
Course Note Credit: Some of slides are extracted from the course notes of prof. Mathieu Desburn (USC) and prof. Han-Wei Shen (Ohio State University). CSC.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
High-Quality Parallel Depth-of- Field Using Line Samples Stanley Tzeng, Anjul Patney, Andrew Davidson, Mohamed S. Ebeida, Scott A. Mitchell, John D. Owens.
For real-time rendering Crysis 3 screenshot -
Tuesday February 19 th, 2002 Deep Shadow Maps Tom Lokovic & Eric Veach Pixar Animation Studios Presented by Tom Lechner.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Shadows.
Week 9 - Wednesday.  What did we talk about last time?  Fresnel reflection  Snell's Law  Microgeometry effects  Implementing BRDFs  Image based.
1 Dr. Scott Schaefer Shadows. 2/40 Shadows Shadows provide clues about depth Make scenes appear more realistic.
Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
A Real-Time Soft Shadow Volume Algorithm DTU Vision days Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Sweden
Skin Rendering GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from David Gosselin’s Power Point and article, Real-time skin rendering,
1 Dynamic Shadows and Lighting for Walkthrus of Large Models Brandon Lloyd COMP 258 December 2002.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University.
Paper by Alexander Keller
4.2. D EFERRED S HADING Exploration of deferred shading (rendering)
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Advanced Computer Graphics Bas Zalmstra Marries van de Hoef Tim de Jager.
Shadow No, not the Hank Marvin kind!. Go to: ows.html ows.html.
Aaron Schultz. Idea: Objects close to a light shadow those far away. Anything we can see from the light’s POV is lit. Everything hidden is dark. Distance.
Shadow Algorithms Ikrima Elhassan.
Filtering Approaches for Real-Time Anti-Aliasing /
Matte Painting 2.5D Environment Milestone 3 March 2009 Øyvind Lien.
NVIDIA PROPRIETARY AND CONFIDENTIAL Occlusion (HP and NV Extensions) Ashu Rege.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Visual quality techniques.
Interactive Time-Dependent Tone Mapping Using Programmable Graphics Hardware Nolan GoodnightGreg HumphreysCliff WoolleyRui Wang University of Virginia.
Jonathan M Chye Technical Supervisor : Mr Matthew Bett 2010.
GAM532 DPS932 – Week 8 Texture Shadow Implementation.
Emerging Technologies for Games Alpha Sorting and “Soft” Particles CO3303 Week 15.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
Tone Mapping on GPUs Cliff Woolley University of Virginia Slides courtesy Nolan Goodnight.
1 Real-time visualization of large detailed volumes on GPU Cyril Crassin, Fabrice Neyret, Sylvain Lefebvre INRIA Rhône-Alpes / Grenoble Universities Interactive.
Shader Study 이동현. Vision engine   Games Helldorado The Show Warlord.
Hardware-accelerated Rendering of Antialiased Shadows With Shadow Maps Stefan Brabec and Hans-Peter Seidel Max-Planck-Institut für Informatik Saarbrücken,
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
Sample Based Visibility for Soft Shadows using Alias-free Shadow Maps Erik Sintorn – Ulf Assarsson – uffe.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Emerging Technologies for Games Deferred Rendering CO3303 Week 22.
Variance Shadow Maps Andrew Lauritzen, RapidMind.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Cool Stuff. Emerging Capabilities Image Processing Massively Multipass.
Edison Gao 主讲人:高原. GameFinal A Next-Gen 3D Game Engine Edison Gao.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
Convolution Shadow Maps * MPI Informatik Germany † Hasselt University Belgium ‡ University College London UK T. Annen * T. Mertens † P. Bekaert † H.-P.
Build your own 2D Game Engine and Create Great Web Games using HTML5, JavaScript, and WebGL. Sung, Pavleas, Arnez, and Pace, Chapter 5 Examples 1.
Shuen-Huei Guan Seminar in CMLab, NTU
CENG 477 Introduction to Computer Graphics
Textures, Sprites, and Fonts
Discrete Techniques.
Real-Time Soft Shadows with Adaptive Light Source Sampling
Chapter X Advanced Texturing
Deferred Lighting.
Alias-Free Shadow Maps
Real-time Rendering Shadow Maps
Real-Time Rendering Intro to Shadows
UMBC Graphics for Games
UMBC Graphics for Games
Chapter XV Shadow Mapping
Frame Buffer Applications
Presentation transcript:

Fast Cascade VSM By Zhang Jian

Dynamic Shadow Tech Shadow Volume Shadow Map PCF VSM CSM ESM PSM LiPSM Basic Algorithm PCF VSM CSM ESM Soft Shadow PSM LiPSM TSM CSM Perspective Alias Convolution Shadow Cascaded Shadow trap·e·zoid PSSM 2D CSM 3D CSM Cascade Selection Per Object Shadow Deferred Shadow Rendering Stage

Outline Basic Shadow Map and problems Variance Shadow Map Cascade Shadow Map In Our Engine Shadow Mask

1. Shadow Map Basic Idea: If a light can see a point, the point will be lit by the light.

1. Shadow Map 1.Render a texture by using light as a camera, that’s shadow map, the pixel value is depth value. 2. Transform the current position into shadow map space (light space), test if it’s occluded by corresponding shadow map pixel. 3. Done! ?

1.Shadow Map Peter panning Perspective Alias

1. Shadow Map Self-shadow Acne Peter panning ac·ne, ai kene discrete buffer Orthographic projection Self-shadow Acne

1.Shadow Map Peter Panning

1.Shadow Map Hard Edge

1. Shadow Map Dynamic Alias: Unstable resolution( PSM) Edge swimming effect There are bunch of shadow techniques has unstable problem, like PSM unstable is very annoying, sometimes, it is even worse than low quality.

2.Variance Shadow Map Soft Shadow

2.Variance Shadow Map Probability theory dr is the current receiver depth d0 is the random variable to represent the occluder depth. VSM is based on Probability theory. Treat Shadow map depth as a random variable , Represents the occluder depth distribution function Our goal : define some states between shadow and lit.

2.Variance Shadow Map Chebyshev’s inequality (when dr > μ) moments M 1 and M 2 μis mean σ2 is variance, sigma squre

2.Variance Shadow Map Understand VSM by your way. float d = ( vLightSpacePos.z ) - Depth; float p_Shadow = 1; if (d > 0) { float variance = ( DepthSquare ) - ( Depth * Depth ); p_Shadow = variance / ( variance + d*d );} moments M 1 and M 2 μis mean σ2 is variance

VSM In Our Engine Render Z and Z2 into a 2 channels render target G16R16 ( hardware filter, 1 cycle) 4x MSAA on Xenon ( Free, No predict-tilling) RGBA8 on PC ( may provide multiple solutions for difference GPU) Prefilter: 2 pass Gaussian blur Generate Mipmaps on Xenon. VSM shadow testing.

2.Variance Shadow Map The good: Very cheap Soft shadow: Support Pre-filter, Blur == PCF. Much Better self shadow quality ( solve the shadow bias perfectly) The ability to use high quality texture filter( trilinear, anistropic filter) Remember the dilemma between shadow bias and peter panning .

2.Variance Shadow Map The Bad: Light leaking. Remember the dilemma of shadow bias and peter panning .

2.Variance Shadow Map Light leaking. Reduce Geometry complexity, use Low Lod for shadow caster. Tune parameters.(remapping the result)

3. Cascaded Shadow Map Resolution problem

Cascaded Shadow Map Fix resolution problem: if we fix shadow map resolution for conventional shadow mapping The far objects require SM cover an area as big as possible, so the far object can cast shadow. The near objects require SM cover an area as small as possible, so the near object can cover enough SM Texel's

Cacade Alignment What will happen if the camera direction changes. See video EdgeShrim.avi

Parallel Split Shadow Map

2D CSM

Z precision problem 3D CSM Side view of ViewFrustum and Light Frustum

Cacade Coverage Optimization PushAway

Cacade Transition

Interlace updating

4. Shadow Mask Just an optimization

4.Shadow Mask Basic Idea

Shadow Mask Why? Shadow calculation can increase shader complexity a lot. For most case, it can avoid overdraw. More aggressive, Postprocess shadow multiply Why shadow mask

Shadow solution

Result Memory: ~5M( 3M Vsm + 2M shadow mask) Performance(ShadowMap+shadowMask): 4 cascade: 2.3-4.5 ms 3 cascade: 1.7-3.5 ms 2 cascade: 1.4-2.5 ms 1 cascade: 1.0~2.0 ms

Future Works Optimization Special Mesh LOD for shadow. Unshadow sky Early out. Shader optimization Transparency shadow (e.g.. Smoke shadow)

Q&A

Declaration This is from one of my internal presentations. I implemented the shadow tech in our game engine, and shared tips and explanations here. It’s not an official paper, So I don’t have a reference docs list here,