LOGO Shadows On the GPU Presented by Lukai Lan. LOGO Contents  Introductions  Recent Shadow Maps  What we are NOT covering today  Perspective Shadow.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

Ray Tracing Depth Maps Using Precomputed Edge Tables Kevin Egan Rhythm & Hues Studios.
Exploration of bump, parallax, relief and displacement mapping
Graphics Pipeline.
An Introduction to Light Fields Mel Slater. Outline Introduction Rendering Representing Light Fields Practical Issues Conclusions.
SDSM SAMPLE DISTRIBUTION SHADOW MAPS The Evolution Of PSSM.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
Eyes for Relighting Extracting environment maps for use in integrating and relighting scenes (Noshino and Nayar)
Two Methods for Fast Ray-Cast Ambient Occlusion Samuli Laine and Tero Karras NVIDIA Research.
Shadow and Shadow Maps [5]. Object without shadow seem floating above the scene Shadow gives the depth information Shadow gives the information of the.
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 Paper Presentation Logarithmic Perspective Shadow Maps Brandon Lloyd Naga Govindaraju Cory Quammen Steve Molnar Dinesh Manocha Slides.
Shadow Silhouette Maps Pradeep Sen, Mike Cammarano, Pat Hanrahan Stanford University.
A Real-Time Soft Shadow Volume Algorithm DTU Vision days Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Sweden
(conventional Cartesian reference system)
Final Gathering on GPU Toshiya Hachisuka University of Tokyo Introduction Producing global illumination image without any noise.
Perspective Shadow Maps Marc Stamminger and George Drettakis Speaker: Alvin Date: 5/28/2003 SIGGRAPH 2002.
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University.
Perspective Shadow Maps Marc Stamminger REVES/INRIA, Sophia-Antipolis, France now at: Bauhaus-Universität, Weimar, Germany George Drettakis REVES/INRIA,
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Computer Graphics Shadows
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
Computer Graphics Mirror and Shadows
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
The Visibility Problem In many environments, most of the primitives (triangles) are not visible most of the time –Architectural walkthroughs, Urban environments.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Week 6 - Wednesday.  What did we talk about last time?  Light  Material  Sensors.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Perspective Shadow Maps Marc Stamminger REVES/INRIA, Sophia-Antipolis, France now at: Bauhaus-Universität, Weimar, Germany George Drettakis REVES/INRIA,
Hardware-accelerated Rendering of Antialiased Shadows With Shadow Maps Stefan Brabec and Hans-Peter Seidel Max-Planck-Institut für Informatik Saarbrücken,
Binary Space Partitioning Trees Ray Casting Depth Buffering
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.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Real-Time Relief Mapping on Arbitrary Polygonal Surfaces Fabio Policarpo Manuel M. Oliveira Joao L. D. Comba.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
1Ellen L. Walker 3D Vision Why? The world is 3D Not all useful information is readily available in 2D Why so hard? “Inverse problem”: one image = many.
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.
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
Shuen-Huei Guan Seminar in CMLab, NTU
- Introduction - Graphics Pipeline
Real-Time Soft Shadows with Adaptive Light Source Sampling
Graphics Processing Unit
Robust Shadow Maps for Large Environments
The Graphics Rendering Pipeline
Models and Architectures
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
Models and Architectures
Models and Architectures
ATO Project: Year 3 Main Tasks
Presentation transcript:

LOGO Shadows On the GPU Presented by Lukai Lan

LOGO Contents  Introductions  Recent Shadow Maps  What we are NOT covering today  Perspective Shadow Maps  Parallel-split Shadow Maps  Summarizations  How would I do shadows

LOGO Introduction  Why do we need shadows?  How High is the tennis player? 3 inches?1 foot?3 feet?Without Shadow

LOGO Introduction  Why do we need shadows? [1]  Shadows add visual information Relative object positions in world. The shape of the receiver object surface. The light source position and shape.  So, shadows add realism to the scene!

LOGO Introduction  Why do we need shadows?  Shadows are popular in games!

LOGO Introduction  Two main categories of Shadow Algorithms  Shadow Volume [2]: First proposed by Crow in 1977.

LOGO Introduction  Two main categories of Shadow Algorithms  Shadow Volume [2]: Accurate to the pixel. Connectivity information of all polygons are required to compute the silhouette of each shadow caster. The scene complexity thus directly influence the performance due to the object-based nature.

LOGO Introduction  Shadow Mapping [3]: First proposed by Williams in First step: Render from the light’s point of view to generate shadow map. –The shadow map contains scene depth values from the current point of view. Second Step: Render the scene from the eye’s point of view: –Transform the current position into light space, and compare its depth values with the depth values stored in the shadow map.

LOGO Introduction  Shadow Mapping [3]: Shadow Map Scene rendered using Shadow Map First StepSecond Step Light

LOGO Introduction  Shadow Mapping [3]: Works in the light space. Requires only one additional rendering pass per light. Faster, but have problems with Aliasing. Most games are using shadow maps.

LOGO Introductions  Main Problems with Shadow Mapping  Aliasing Errors! Caused by insufficient shadow map resolution, also called Undersampling. perspective aliasing projection aliasing

LOGO Recent Shadow Maps  Warped shadow maps  Use a special projection matrix to warp the shadow map so that the important parts, close to the viewpoint of the scene, appear larger in the shadow map and therefore reduce artifacts.  Major approaches: Perspective Shadow Maps [4] Light Space Perspective Shadow Maps [5] Trapezoid Shadow Maps [6]

LOGO Recent Shadow Maps  Split Shadow Maps  Divide up the view frustrum into several parts, rendering each part as a separate map or tile.  Varying the size of each tile or the area it covers.  Render more details into tiles closer to the view point and reduce aliasing in those tiles.  Widely used in games  Major approaches: Cascaded Shadow Maps [7] Parallel-split Shadow Maps [8]

LOGO What we are NOT covering today  Shadow Volume [2] Doom 3

LOGO What we are NOT covering today  Some Shadow Mapping Approaches  Light Space Perspective Shadow Maps [5]  Trapezoid Shadow Maps [6]  Facetted Shadow Maps [9] GTA 4

LOGO What we are covering today  Perspective Shadow Maps  STAMMINGER, M., AND DRETTAKIS, G In Proceedings of SIGGRAPH '02, ACM Press,  Parallel-split Shadow Maps for Large-scale Virtual Environments  Fan Zhang, Hanqiu Sun, Leilei Xu, Lee Kit Lun, Proceedings of the 2006 ACM international conference, June 14-April 17, 2006, Hong Kong, China

LOGO Perspective Shadow Maps  Marc Stamminger, George Drettakis, Perspective shadow maps, Proceedings of the 29 th annual conference on Computer graphics and interactive techniques, July 23-26, 2002, San Antonio, Texas

LOGO Perspective Shadow Maps  Main Contribution  In this paper they introduced perspective shadow maps, which are generated in normalized device coordinate space. This results in important reduction of shadow map aliasing with almost no overhead.

LOGO Perspective Shadow Maps  Shadow Map Aliasing

LOGO Perspective Shadow Maps  Shadow Map Aliasing  Perspective Aliasing Undersampling appears when d is larger than the image pixel size. Can be avoided by keeping the fraction close to a constant. Due to limited memory, the shadow map resolution can only be increased up to a certain limit in practice.

LOGO Perspective Shadow Maps  Shadow Map Aliasing  Projection Aliasing Appears when is large Typically happens when the light rays are almost parallel to a surface, so that the shadow stretches along the surface. Require a local increase in shadow map resolution. Not deal with this paper.

LOGO Perspective Shadow Maps  Main Idea  Try to keeping the fraction close to a constant.  How to do that? First map the scene to post-perspective space Generate a standard shadow map in this space by rendering a view from the transformed light source. We can work in post-perspective space almost like in world space, with the exception of objects behind the viewer

LOGO Perspective Shadow Maps  Overview

LOGO Perspective Shadow Maps  Directional Light Sources

LOGO Perspective Shadow Maps  Point Light Sources

LOGO Perspective Shadow Maps  Discussions  In post-perspective space, the final image is an orthogonal view onto the unit cube.  Perspective aliasing due to distance to the eye,, is avoided  However, if the light source is mapped to a point light in post-perspective space, aliasing due to the distance to the shadow map image plane,, can appear.

LOGO Perspective Shadow Maps  Discussions  Ideal cases

LOGO Perspective Shadow Maps  Discussions  For directional light sources the benefit is maximal for a light direction perpendicular to the view direction. Consider the smaller of the two angles formed between the light direction and the viewing direction, the benefit of this approach decreases as this angle becomes smaller.  For point light sources Analysis is harder Achieve largest advantages when the point light is far away from the viewing frustum,

LOGO Perspective Shadow Maps  Including all Objects Casting Shadows

LOGO Perspective Shadow Maps  Including all Objects Casting Shadows

LOGO Perspective Shadow Maps  Including all Objects Casting Shadows  We virtually move the camera view point backwards, such that H lies entirely inside the transformed camera frustum;  By this, we modify the post-perspective space, resulting in decreased perspective foreshortening.  If we move the camera to infinity, we obtain an orthogonal view with a post-perspective space that is equivalent to the original world space; the resulting perspective shadow map then corresponds to a standard uniform shadow map.

LOGO Perspective Shadow Maps  Results Uniform Shadow map Perspective Shadow map

LOGO Perspective Shadow Maps  Results Left is Uniform shadow maps, right is Perspective Shadow Maps

LOGO Perspective Shadow Maps  Results

LOGO Perspective Shadow Maps  Results

LOGO Perspective Shadow Maps  Conclusions  They introduced perspective shadow maps, a novel parameterization for shadow maps.  Their method permits the generation of shadow maps with greatly improved quality, compared to standard uniform shadow maps.  Perspective shadow maps can be used in interactive applications and fully exploit shadow map capabilities of recent graphics hardware, but they are also applicable to high-quality software renderers.

LOGO Parallel-split Shadow Maps  Fan Zhang, Hanqiu Sun, Leilei Xu, Lee Kit Lun, Parallel-split shadow maps for large-scale virtual environment Proceedings of the 2006 ACM international conference, June 14-April 17, 2006, Hong Kong, China

LOGO Parallel-split Shadow Maps  Main Contribution  In this paper, they present the Parallel-Split Shadow Maps (PSSMs) scheme, which splits the view frustum into different parts by using the planes parallel to the view plane and then generates multiple smaller shadow maps for the split parts.

LOGO Parallel-split Shadow Maps  Shortcomings of shadow mapping for large-scale virtual environments  Texture Resolution  Global Reparameterizations  Geometry Approximation  Dueling Frusta Case

LOGO Parallel-split Shadow Maps  Motivation to avoid these shortcomings due to the facts  Each of the split parts has an independent shadow map, different parameterizations can be applied in different depth ranges according to the application's requirement.  Since the depth range is split into smaller layers, split scheme changes the resolution requirement from sufficient for every point to sufficient for every depth layer.

LOGO Parallel-split Shadow Maps  Motivation to avoid these shortcomings due to the facts  The geometry approximation is applied in each of the depth ranges separately. The tighter bounding shape significantly enhances the utilization of the shadow map resolution.  Because each shadow map in PSSMs is focused in smaller sub frusta, the shadow qualities in the dueling frusta case is also greatly improved.

LOGO Parallel-split Shadow Maps  Overview

LOGO Parallel-split Shadow Maps  Light Sources  Actually, all kinds of lighting sources including point lighting sources can be unified as directional lighting sources in the light's post-perspective space.

LOGO Parallel-split Shadow Maps  PSSM Algorithm Overview  STEP 1 Split the view frustum into multiple depth parts.  STEP 2 Split the light's frustum into multiple smaller ones, each of which covers one split part also the objects potentially casting shadows into the part.  STEP 3 Render a shadow map for each split part.  STEP 4 Render scene shadows for the whole scene.

LOGO Parallel-split Shadow Maps  Some notations

LOGO Parallel-split Shadow Maps  View Frustum Split

LOGO Parallel-split Shadow Maps  View Frustum Split  Aliasing Problem Perspective Aliasing: comes from the perspective foreshortening effect, can be reduced by applying a global transformation to warp the shadow map texels. Projection Aliasing: related to the scene's geometry details, the local increase of sampling densities on this surface is required to reduce this category of aliasing. Split scheme comes from these analysis

LOGO Parallel-split Shadow Maps  View Frustum Split  Three kinds of split

LOGO Parallel-split Shadow Maps  Logarithmic Split Scheme  Suppose to be constant  Then we can deduce  Based on the assumption of, easily we have, then we can get

LOGO Parallel-split Shadow Maps  Logarithmic Split Scheme  Equation can be discretized as  Or  Because this split scheme is designed to produce the theoretically even distribution of perspective aliasing errors, the resolution allocated for should be of the overall texture resolution.  Finally, we get

LOGO Parallel-split Shadow Maps  Logarithmic Split Scheme  The main drawback of this split scheme is that the lengths of split parts near the viewer are too small, so few objects can be included in these split parts.  This is due to the theoretically optimal parameterization assumes that the shadow map accurately covers the view frustum and no any resolution is wasted on invisible parts of the scene.

LOGO Parallel-split Shadow Maps  Uniform Split Scheme  The simplest split scheme is to place the split planes uniformly along the z axis:  Because  The perspective aliasing is

LOGO Parallel-split Shadow Maps  Uniform Split Scheme  Perspective aliasing in uniform reparameterizations increases hyperbolically as the object moves near to the view plane.  Therefore, uniform split scheme results in under-sampling at the points near the viewer, over-sampling at the points further from the viewer.

LOGO Parallel-split Shadow Maps  Practical Split Scheme  Logarithmic split scheme provides the theoretically optimal aliasing distribution, while uniform split scheme results in the theoretically worst aliasing distribution.  Practical split scheme is designed to moderate sampling densities in the above two extreme split schemes.  Or

LOGO Parallel-split Shadow Maps  View Frustum Split  Three kinds of split

LOGO Parallel-split Shadow Maps  Light's Frustum Split

LOGO Parallel-split Shadow Maps  Scene-shadows Rendering  Like standard shadow mapping, each pixel should be transformed into the light space when determining if the pixel is shadowed or not.  The differences here are: Select the correct shadow map The pixel should be transformed into rather W.

LOGO Parallel-split Shadow Maps  Scene-shadows Rendering  Multiple texture maps are required.  In order to avoid multiple passes for the final scene-shadows rendering, they utilized pixel shader available on programmable GPUs.  For each rasterized fragment, they sample the appropriate shadow map based on the depth value of this fragment.

LOGO Parallel-split Shadow Maps  Scene-shadows Rendering  In the view space, obviously should be used for points located in the range.  However, in the fragment buffer, the coordinates are measured in the clip space. So we need to transform  If, the is selected

LOGO Parallel-split Shadow Maps  Results SSM TSM PSM PSSM(3)

LOGO Parallel-split Shadow Maps  Results SSM TSM PSM PSSM(3)

LOGO Parallel-split Shadow Maps  Results

LOGO Parallel-split Shadow Maps  Conclusions  This paper developed the Parallel-Split Shadow Maps (PSSMs) scheme, which splits the view frustum into different depth ranges by using split planes parallel to the view plane, and then renders multiple shadow maps for the split parts.  They proposed a fast and robust split scheme without expensive scene analysis per frame, which produces moderate sampling densities over the whole depth range.  Future work: hardware-accelerated PSSMs to reduce rendering passes for the generation of shadow maps (e.g. using MRT on current shader model).

LOGO Summarizations  Shadowing effects dramatically enhance the realism of virtual environments by providing useful visual cues.  Shadowing algorithm can be divided into two main categories: Shadow Volume and Shadow Mapping  Most of games are using shadow mapping as it is much faster.  Several approach has been conducted to improve the shadow mapping quality. They can be classified as two group: Warped shadow maps and split shadow maps.  Split shadow maps are most popular in nowadays game engine.

LOGO How would I do shadows  If give me some time, like say 6 weeks, I would like to try to implement Parallel-split Shadow Maps or Cascaded Shadow Maps. Because they produce very good results with a relative low cost compared to Shadow Volume algorithms.  I would build up a simple scene graph system, and then focus on implementing the split shadow maps algorithm. After I accomplish it, I would build a scene involving several objects and light sources to demonstrate my implementation.

LOGO References  [1] John R. Isidoro, Shadow Mapping: GPU-based Tips and Techniques, Game Developers’ Conference  [2] CROW, F. C Shadow algorithms for computer graphics. In Proceedings of SIGGRAPH '77, ACM Press,  [3] WILLIAMS, L Casting curved shadows on curved surfaces. In Proceedings of SIGGRAPH '78, ACM Press,  [4] STAMMINGER, M., AND DRETTAKIS, G Perspective shadow maps. In Proceedings of SIGGRAPH '02, ACM Press,  [5] WIMMER, M., SCHERZER, D., AND PURGATHOFER, W Light space perspective shadow maps. In the Eurographics Symposium on Rendering 2004, Eurographics, Eurographics Association.  [6] MARTIN, T., AND TAN, T.-S Anti-aliasing and continuity with trapezoidal shadow maps. In the Eurographics Symposium on Rendering 2004, Eurographics, Eurographics Association.  [7] Wolfgang Engel, Cascaded Shadow Maps, Shader X5, 2006  [8] Fan Zhang, Hanqiu Sun, Leilei Xu, Lee Kit Lun, Parallel-split shadow maps for large-scale virtual environments, Proceedings of the 2006 ACM international conference, June 14-April 17, 2006, Hong Kong, China  [9] Ray Tran, Facetted Shadow Mapping for Large Dynamic Game Enviroments, Shader X7, 2008

LOGO