Computer Graphics Shadows

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Game Programming 09 OGRE3D Lighting/shadow in Action
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Week 9 - Friday.  What did we talk about last time?  Area lighting  Environment mapping  Blinn and Newell's method  Sphere mapping  Cubic environmental.
Computer Graphics methods
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
3D Graphics Rendering and Terrain Modeling
Shadow and Shadow Maps [5]. Object without shadow seem floating above the scene Shadow gives the depth information Shadow gives the information of the.
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.
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering Cass Everitt and Mark J. Kilgard Speaker: Alvin Date: 5/28/2003 NVIDIA.
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,
Shadow Algorithms Gerald Matzka Computer Science Seminar.
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University.
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.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
9/20/2001CS 638, Fall 2001 Today Finishing Up Reflections More Multi-Pass Algorithms Shadows.
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
Shadow Algorithms Ikrima Elhassan.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
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.
-Global Illumination Techniques
Game Programming (Mapping) Spring.
CHAPTER 11 Shadows © 2008 Cengage Learning EMEA. LEARNING OBJECTIVES In this chapter you will learn about: – –Shadow rendering algorithms – –Blinn’s shadow.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
MIT EECS 6.837, Durand and Cutler Real-Time Shadows.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Shadows (2) ©Anthony Steed Overview n Shadows – Umbra Recap n Penumbra Analytical v. Sampling n Analytical Aspect graphs Discontinuity meshing.
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
Shadows. Shadows is important in scenes, consolidating spatial relationships “Geometric shadows”: the shape of an area in shadow Early days, just pasted.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
CS-378: Game Technology Lecture #8: More Mapping Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
Computer graphics & visualization Shadows / Transparency.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
Local Illumination and 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.
Non-Photorealistic Rendering FORMS. Model dependent Threshold dependent View dependent Outline form of the object Interior form of the object Boundary.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Shadows & occlusion  Shadow - occlusion duality  Floor shadows.
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
Applications and Rendering pipeline
Rendering Pipeline Fall, 2015.
Discrete Techniques.
Real-Time Soft Shadows with Adaptive Light Source Sampling
Photorealistic Rendering vs. Interactive 3D Graphics
3D Graphics Rendering PPT By Ricardo Veguilla.
Models and Architectures
Jim X. Chen George Mason University
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Real-Time Rendering Intro to Shadows
Models and Architectures
Texture and Shadow Mapping
Models and Architectures
Frame Buffer Applications
Presentation transcript:

Computer Graphics Shadows Taku Komura Lecture 9

Today Shadows Overview Projective shadows Shadow texture Shadow volume Shadow map Lecture 9

Why Shadows? Shadows tell us about the relative locations and motions of objects Lecture 9

Shadows and Motion Humans conceive the motion of objects using shadows Demo movie http://gandalf.psych.umn.edu/users/kersten/kersten-lab/images/ball-in-a-box.mov Lecture 9

Facts about Shadows Shadows can be considered as areas hidden from the light source A shadow on A due to B can be found by projecting B onto A with the light as the center of projection Suggests the use of projection transformations Point lights have hard edges, and area lights have soft edges Lecture 9

Soft and hard shadows Soft shadows Hard shadows Lecture 9

Today Shadows Overview Projective shadows Shadow texture Shadow volume Shadow map Lecture 9

Ground Plane Shadows Shadows cast by point light sources onto planes are an important case that is relatively easy to compute Shadows cast by objects (cars, players) onto the ground L(light position)‏ (lx,ly,lz)‏ (xp,yp,zp)‏ (xsw,ysw,zsw)‏ Lecture 9

Point Light Shadows Light source Object Floor Lecture 9

Point Light Shadows Blinn ’88 gives a matrix that works for local point light sources Takes advantage of perspective transformation (and homogeneous coordinates)‏ Lecture 9

Drawing the Shadow We now have a matrix that transforms an object into its shadow Drawing the shadow: Draw the polygon Multiply the shadow matrix into the model transformation Redraw the object in grey with blending on Tricks: Lift the shadow a little off the plane to avoid z-buffer quantization errors (can be done with extra term in matrix)‏ Lecture 9

Lifting the shadow above the surface Light Viewer Shadow height equal with hit polygon Z-buffer quantization errors Shadow height above hit polygon Lecture 9

Point Light Shadows : problem shadows can only be cast onto planes and not on arbitrary objects. the resulting shadows generated have hard edges If there is a texture on the floor, grey shadows look bad If we use blending, the shadow part with multiple polygons overlapping will look darker The shadows need to be re-rendered at every frame although its shape is view independent Lecture 9

Improving Planar Projected Shadows with Stencil Only pixels tagged with the ground plane’s unique stencil value will be updated when the shadow is rendered. When a shadow is rendered, the stencil value is set to zero subsequent pixel updates will fail Lifting the shadows above the floor not necessary, stencil buffer used to avoid rendering the floor over the shadow region Lecture 9

Shadow Texture Use a shadow image as a projective texture Generate an image of the occluder from the light’s view and color it grey Project this image onto the background and render it using texture mapping Can render shadows over curved surfaces Lecture 9

Shadow Texture : Drawbacks The occluder and receiver must be specified Occluding objects cannot shadow themselves Magnification of textures Resolution must be adapted Lecture 9

Adaptive Shadow Mapping The resolution of the shadow maps is lower than that of the rendered image Many box shape artifacts Need to use shadow map of higher resolutions Changing the resolution of the shadow map according to the viewpoint Adaptive Shadow Maps, Fernando et al. SIGGRAPH 2001 Lecture 9

Today Shadows Overview Projective shadows Shadow texture Shadow volume Shadow map Lecture 9

Shadow Volume In the real world, the shadow cast by an object blocking a light is a volume, not merely some two-dimensional portion of a plane. An algorithm that models shadow regions as volumes. Lecture 9

Using Shadow Volumes to Render Shadows Two stages Compute the shadow volume formed by a light source and a set of shadowing objects. Check whether the point is inside / outside the shadow volume inside  shadowed Outside  illuminated by light source Lecture 9

Procedure Get the polygonal boundary representation for the shadow volume Render the scene with ambient light Clear the stencil buffer, and render the shadow volume with the colour buffer off Whenever a rendered fragment of the shadow volume is closer than the depth of the other objects, invert a bit in the stencil value for that pixel After rendering, if the bit is on, then it means the fragment is inside the shadow volume, so must be shadowed Otherwise outside the shadow Render the scene with the diffuse & specular components active, but only for pixels the stencil is off Lecture 9

Lecture 9

Advantage / Disadvantages of Shadow Volume It can be used on general-purpose graphics hardware Only using the stencil buffer Disadvantage Bottle neck at the rasterizer Many shadow volumes covering many pixels Lecture 9

Shadow Mapping A method using the Z-buffer Render the scene from the light source using the Z-buffer algorithm The Z-buffer contains the distance to the object shadow depth map / shadow buffer Render the scene from the view point Compute the coordinates of the sampled points in each light space If the rendered vertex is farther away from the value in the Z-buffer, it is in the shadow Lecture 9

Shadow Map Checking whether Va,Vb is closer to the light Lecture 9

Shadow Map Preparation Prepare a depth buffer for each light Render the scene from the light position Save the depth information in the depth buffer Rendering the scene Render the objects; whenever rendering an object, check if it is shadowed or not by transforming its coordinate into the light space After the transformation, if the depth value is larger than that in the light’s depth buffer it should be shadowed Lecture 9

Shadow Map Advantage Don’t need a stencil buffer When there are many shadows, it is faster then shadow volume Disadvantage Less accurate than the shadow volume The precision is restricted by the resolution of the depth buffer When the object is far from the light, magnification can happen Lecture 9

Soft Shadows Made by area light umbra – totally blocked from the light source Penumbra – partially blocked from the light source Can be modelled by a collection of point light sources Lecture 9

Soft shadowing by multiple point light sources Additive blending is used to accumulate the contribution of each light. The softness of the shadow depends on an adequate number of samples. The time to render the scene increases linearly with the number of samples used to approximate an area light source. Artifacts are introduced if not enough samples are used Apply convolution Can apply both planar projected shadows approach or shadow volume approach Drawback: slow Lecture 9

Other techniques to generate soft shadow : Gooch et al. Moving the projected plane up and down instead of moving the light source The projections cast upon it are averaged Only one projection matrix is required “Interactive technical illustration” Gooch et al. I3D 1998 Lecture 9

Other techniques to generate soft shadow : Haines, 2001 First create a hard shadow and then paint the silhouette edges with gradients that go from dark in the center to white on the edges The gradient areas have a width proportional to the height of the silhouette edge casting the shadow Lecture 9

Problems with Gooch et al. and Haine’s method The umbra ( the dark shadowed area) becomes too large as it is produced by a point light An area light usually decreases the size of the umbra Lecture 9

Readings Real-time Rendering 2nd Edition Chapter 6.12 Foley, Chapter 16.4 Lecture 9