Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.

Slides:



Advertisements
Similar presentations
15.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 15 – Visible Surfaces and Shadows.
Advertisements

16.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 16 – Some Special Rendering Effects.
8.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 8 Polygon Rendering.
Exploration of advanced lighting and shading techniques
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Exploration of bump, parallax, relief and displacement mapping
Graphics Pipeline.
GAM532 DPS932 – Week 7 Introduction to shadows. Shadow Effects Light Surface No Shadows Shadows.
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.
Projective Texture Mapping
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Week 11 - Wednesday.  Image based effects  Skyboxes  Lightfields  Sprites  Billboards  Particle systems.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Shadows.
SE 313 – Computer Graphics Lecture 13: Lighting and Materials Practice Lecturer: Gazihan Alankuş 1.
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.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
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 Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Computer Graphics Shadows
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
Hidden Surface Removal
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
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.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Computer Graphics Texture Mapping
Week 2 - Wednesday CS361.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Textures.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
GAM532 DPS932 – Week 8 Texture Shadow Implementation.
Emerging Technologies for Games Alpha Sorting and “Soft” Particles CO3303 Week 15.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics Module Review CO2409 Computer Graphics.
Week 10 - Wednesday.  What did we talk about last time?  Shadow volumes and shadow mapping  Ambient occlusion.
Lecture 6: 3D graphics Concepts 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271 
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
CS-378: Game Technology Lecture #4: Texture and Other Maps Prof. Okan Arikan University of Texas, Austin V Lecture #4: Texture and Other Maps.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Games Development 1 Camera Projection / Picking CO3301 Week 8.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Emerging Technologies for Games Deferred Rendering CO3303 Week 22.
Computer Graphics Blending CO2409 Computer Graphics Week 14.
Computer Graphics Camera Projection / Picking CO2409 Week 8 - Optional Advanced Material Not on Exam.
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.
Rendering Pipeline Fall, 2015.
- Introduction - Graphics Pipeline
Week 7 - Monday CS361.
Photorealistic Rendering vs. Interactive 3D Graphics
CSC461: Lecture 20 Parallel Projections in OpenGL
Robust Shadow Maps for Large Environments
CS451Real-time Rendering Pipeline
Introduction to Computer Graphics with WebGL
Computer Graphics Module Review
CS-378: Game Technology Lecture #4: Texture and Other Maps
Computer Graphics Material Colours and Lighting
Frame Buffer Applications
Presentation transcript:

Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20

Lecture Contents 1.Basic Shadows 2.Pre-calculated Shadows 3.Shadow Mapping

Basic Shadows Shadows in a scene to help resolve the relative positions of models –Naive mistake to think that shadows happen automatically with lighting A couple of basic techniques have long been used: –Draw a “blob” under a model –Draw the model flattened (scaled to 0 in Y) on the floor Can project straight down or away from the light Both methods require a flat floor to work correctly Positions Ambiguous? Shadows Resolve

Basic Shadows These methods are still frequently used, why? Basic methods are enough to resolve model positions Very cheap techniques – good when many models –More advanced techniques are complex and slow Advanced techniques often draw attention to themselves: –Sharp edges / too stark, problems in complex cases In wide-open areas, shadows will tend to blur towards blobs in any case –Viewer may not notice / appreciate better accuracy Basic Shadows are still widely used

Pre-calculated Shadows However, improved shadows can give a better sense of space and/or atmosphere Can pre-calculate light / shadows for the static models and lights in the scene Commonly used are static shadow maps / lightmaps –Light / shadow textures applied over the main model textures The maps are pre-calculated –Using high-quality techniques Sometimes called baking the shadows / lighting Lightmass from Unreal 3 Tool to bake shadow / lightmaps

Static Shadows / Dynamic Models Baked shadows work well for static environments –High quality, generated offline Dynamic models also need to be affected by these shadows So store samples of the static lighting at points where dynamic models will be –Both on the floor and in the air Model uses local static lighting samples to affect how it is lit

Dynamic Shadow Mapping We also need to cast shadows from dynamic models Dynamic Shadow Mapping is an extension of render-to texture techniques used for shadows –Also called perspective shadow mapping (PSM) –Or more commonly, just shadow mapping The scene is rendered to a texture (a shadow map), from the point of view of the light Then the scene is rendered normally, but each pixel first tested against shadow map –The pixel is not lit if it is in shadow from the light

Shadow Mapping Method Create a render target texture for each light: –Each “pixel” in the texture is a single floating-point value Instead of four R,G,B & A values –This is a floating-point texture Render the scene from the light’s point of view –Treat the light like a camera For each pixel, render the distance at that pixel only –Result is a like a depth buffer for the scene from the light’s point of view –Sometimes called a light map or (confusingly) a shadow map

Shadow Mapping Method After creating a textures for each light’s point of view, we next render the scene normally –Using an extra step to find shadowed areas In this main render step, we check the pixel’s visibility from each light before applying lighting to it: –Find the distance from the pixel we’re rendering to the light –Also find where this pixel would appear in the light’s depth map –Find the distance stored in the light’s depth map at that point –If the distance stored in the map is less than the actual distance from pixel to light, then something is obscuring the pixel The pixel in shadow from this light –This condition determines whether the pixel gets a diffuse / specular contribution from this light or not –Repeat for all lights on this pixel

Shadow Mapping Diagram Determining if the red pixel is in shadow from the white light It is – the troll’s head is in the way. The red pixel is hidden in the light map

Shadow Mapping Detail 1 To treat a light as a camera, we need a view & projection matrix for it –So we need: position, orientation, FOV and near / far clip planes A spotlight is the simplest case: –Already has a position and facing direction – can make view matrix –Has a field of view (FOV) for projection matrix A point light shines in all directions –We make six cameras pointing in each of the world axis directions –A FOV of 90° for each one –This is an example of a cube map Point Light = 6 Cameras

Shadow Mapping Detail 2 A directional light poses two problems: –No position as a camera. No FOV to use Solve first problem by “positioning” the directional light very far away – outside the scene Solve the second by using an orthogonal projection matrix Project vertices from 3D to 2D along parallel lines –Not towards camera point like standard perspective projection –Don’t need FOV

Shadow Mapping Issues Shadow mapping has two key problems: –Texels of shadow map may be visible, affects shadow quality –Polygons sometimes self-shadow Increase shadow map resolution for better quality –But lower performance, increased memory –Better to adapt resolution based on distance from viewer Good idea to blur or soften the shadows / map –Many methods here, e.g. Variance Shadow Mapping Self-shadowing resolved by tweaking calculated and compared depth –Other solutions illustrated in lab