Real-time Shadow Mapping. Shadow Mapping Shadow mapping uses two-pass rendering - render depth texture from the light ’ s point-of-view - render from.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

POST-PROCESSING SET09115 Intro Graphics Programming.
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Graphics Pipeline.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Projective Texture. Spring Projective Texture Texture projected on a scene as if by a projector Can also be used to generate spot light and shadows.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
9/25/2001CS 638, Fall 2001 Today Shadow Volume Algorithms Vertex and Pixel Shaders.
Real-time Dynamic HDR Based Lighting in a Static Environment Marcus Hennix Daniel Johansson Gunnar Johansson Martin Wassborn.
Real-Time Rendering COMS , Lecture 9. Real-Time Rendering Demo Motivation: Interactive rendering with complex natural illumination and realistic,
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
Part I: Basics of Computer Graphics Viewing Transformation and Coordinate Systems Chapter
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering Cass Everitt and Mark J. Kilgard Speaker: Alvin Date: 5/28/2003 NVIDIA.
Shadow Silhouette Maps Pradeep Sen, Mike Cammarano, Pat Hanrahan Stanford University.
(conventional Cartesian reference system)
CS 4731: Computer Graphics Lecture 19: Shadows Emmanuel Agu.
Perspective Shadow Maps Marc Stamminger and George Drettakis Speaker: Alvin Date: 5/28/2003 SIGGRAPH 2002.
Real-Time High Quality Rendering COMS 6160 [Fall 2004], Lecture 4 Shadow and Environment Mapping
Computer Graphics Shadows
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
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
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.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Geometric Objects and Transformations. Coordinate systems rial.html.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Sebastian Enrique Columbia University Real-Time Rendering Using CUReT BRDF Materials with Zernike Polynomials CS Topics.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
Cass Everitt NVIDIA Corporation Shadow Mapping.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
GAM532 DPS932 – Week 8 Texture Shadow Implementation.
Foundations of Computer Graphics (Fall 2012) CS 184, Lectures 13,14: Reviews Transforms, OpenGL
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Shadows. Shadows is important in scenes, consolidating spatial relationships “Geometric shadows”: the shape of an area in shadow Early days, just pasted.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
OpenGL Shadow. Content Shadowing using Stencil Buffer Shadowing using Projective Texture Shadow map Shadow volume.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.
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.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
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.
1 Shadow Rendering Techniques: Hard and Soft Author: Jamiur Rahman Supervisor: Mushfiqur Rouf Department of CSE BRAC University.
CSE 681 Introduction to Ray Tracing. CSE 681 Ray Tracing Shoot a ray through each pixel; Find first object intersected by ray. Image plane Eye Compute.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Shuen-Huei Guan Seminar in CMLab, NTU
Bbm421 – Computer Games Technology
- Introduction - Graphics Pipeline
Reflective Shadow Mapping By: Mitchell Allen.
Programmable Pipelines
CS451Real-time Rendering Pipeline
Introduction to Computer Graphics with WebGL
CSL 859: Advanced Computer Graphics
Real-time Rendering Shadow Maps
UMBC Graphics for Games
Lecture 13 Clipping & Scan Conversion
UMBC Graphics for Games
Introduction to Computer Graphics
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Frame Buffer Applications
Projections.
Presentation transcript:

Real-time Shadow Mapping

Shadow Mapping Shadow mapping uses two-pass rendering - render depth texture from the light ’ s point-of-view - render from the eye ’ s point-of-view using depth texture Completely image-space implementation - no knowledge of scene ’ s geometry is required - must deal with aliasing artifacts

First Pass(1) The scene is rendered from the light ’ s point of view into the depth texture

First Pass(2) The result is a “ depth texture ” or “ shadow map ” - essentially a 2D function indicating the depth of the closest pixels to the light

Second Pass The scene is rendered from the eye ’ s point of view For each rasterized fragment - determine fragment ’ s XYZ position relative to the light - this light position should be setup to match the frustum used to create the depth texture - compare the depth value at light position XY in the depth texture to fragment ’ s light position Z

Depth Texture Comparison(1) Two values - A = Z value from depth texture at fragment ’ s light XY position - B = Z value of fragment ’ s XYZ light position If B is greater than A, then there must be something closer to the light than the fragment so the fragment is in shadow If A and B are approximately equal, the fragment is lit

Depth Texture Comparison(2)

Depth Texture Comparison(3) The A < B shadowed fragment case

Depth Texture Comparison(4) The A = B shadowed fragment case

Using Projective Texturing(1)

Using Projective Texturing(2) Normal 2D texture mapping uses (s, t) coordinates Now consider homogeneous texture coordinates - r/q holds the distance from the light - (s, t, r, q) --> (s/q, t/q, r/q) - similar to homogeneous clip coordinates where (x, y, z, w) = (x/w, y/w, z/w) Next compare texture value at (s/q, t/q) to value r/q - if texture[s/q, t/q]  r/q then not shadowed - if texture[s/q, t/q] < r/q then shadowed

Ambient Shadows Improvement for completely black shadows

Near and Far planes Distance between near and far planes should be minimized for better precision of Z value

Z-Fighting Problem take place when eye space pixel coordinates are transformed into light space to get the respective depth texture samples due to machine rounding errors in this stage

Aliasing Problems There is still the problem of aliasing

Summary

Implementation First pass uses the OpenSceneGraph library which based on OpenGL Second pass is done by hardware using cg and glsl language shaders