Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

Lecture 8 Transparency, Mirroring
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.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Graphics 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
Computer graphics & visualization Global Illumination Effects.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
3D Graphics Rendering and Terrain Modeling
Part I: Basics of Computer Graphics
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
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.
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,
Real-Time High Quality Rendering COMS 6160 [Fall 2004], Lecture 4 Shadow and Environment Mapping
7M836 Animation & Rendering
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
02/04/03 Page 1 Rendering Visibility Lighting Texturing.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Other Rendering Techniques Types of rendering – Wireframe techniques – Scan-line conversion – Reyes.
Week 14 - Wednesday.  What did we talk about last time?  Collision handling  Collision detection  Collision determination  Collision response  BSPs.
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.
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
Week 15 - Wednesday CS361.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
CS 638, Fall 2001 Today Light Mapping (Continued) Bump Mapping with Multi-Texturing Multi-Pass Rendering.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
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.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Week 10 - Wednesday.  What did we talk about last time?  Shadow volumes and shadow mapping  Ambient occlusion.
1 10/24/ :01 UML Graphics II Shadows Session 4.
Shadows. Shadows is important in scenes, consolidating spatial relationships “Geometric shadows”: the shape of an area in shadow Early days, just pasted.
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.
Binary Space Partitioning Trees Ray Casting Depth Buffering
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
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.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Week 2 - Friday CS361.
3D Graphics Rendering PPT By Ricardo Veguilla.
Jim X. Chen George Mason University
Introduction to Computer Graphics with WebGL
Lighting.
Real-time Rendering Shadow Maps
UMBC Graphics for Games
Last Time Presentation of your game and idea Environment mapping
Patrick Cozzi University of Pennsylvania CIS Fall 2012
Frame Buffer Applications
Presentation transcript:

Week 10 - Monday

 What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows

 Project the object onto a plane  Gives a hard shadow  Needs tricks if the object is bigger than the plane  Gets an antishadow if the light is between occluder and receiver  Soften the shadow  Render the shadow multiple times  Blur the projection  Put gradients around the edges

 Think of shadows from the light's perspective  It "sees" whatever is not blocked by the occluder  We can render the occluder as black onto a white texture  Then, compute (u,v) coordinates of this texture for each triangle on the receiver  There is often hardware support for this  This is known as the shadow texture technique

 Weaknesses  The program has to know which objects are occluders and which are receivers ▪ It has to be careful not to cast onto receivers that do not have the light blocked (antishadows)  Occluders cannot shadow themselves  Strengths  If the occluders do not change shape, the shadow texture can be reused  A variation of the idea can be used to make complicated shadow textures (e.g. Venetian blinds)

 Shadow volumes are another technique for casting shadows onto arbitrary objects  Setup:  Imagine a point and a triangle  Extending lines from the point through the triangle vertices makes an infinite pyramid  If the point is a light, anything in the truncated pyramid under the triangle is in shadow  The truncated pyramid is the shadow volume

 Follow a ray from the eye through a pixel until it hits the object to be displayed  Increment a counter each time the ray crosses a frontfacing face of the shadow volume  Decrement a counter each time the ray crosses a backfacing face of the shadow volume  If the counter is greater than zero, the pixel is in shadow  Idea works for multiple triangles casting a shadow

 Calculating this geometrically is tedious and slow in software  We use the stencil buffer instead  Clear the stencil buffer  Draw the scene into the frame buffer (storing color and Z-data)  Turn off Z-buffer writing (but leave testing on)  Draw the frontfacing polygons of the shadow volumes on the stencil buffer (with incrementing done)  Then draw the backfacing polygons of the shadow values on the stencil buffer (with decrementing done)  Because of the Z-test, only the visible shadow polygons are drawn on the stencil  Finally, draw the scene but only where the stencil buffer is zero

 It is possible to use color or alpha buffers instead  If shadow volumes don't overlap, we can do the information in one pass, with a single bit of information  If the viewer is inside a shadow volume, we have to change the algorithm  If shadow volume planes intersect the near plane of the viewing frustum, bad things happen

 Another technique is to render the scene from the perspective of the light using the Z-buffer algorithm, but with all the lighting turned off  The Z-buffer then gives a shadow map, showing the depths of every pixel  Then, we render the scene from the viewer's perspective, and darken those pixels that are further from the light than their corresponding point in the shadow map

Scene without shadows Scene from the light's viewpoint Depth map from the light's viewpoint Depth of the light compared to depth of the image Depth test fails Scene with shadows

 Strengths:  A shadow map is fast  Linear for the number of objects  Weaknesses:  A shadow map only works for a single light, but you can combine multiple maps for multiple lights  Objects can shadow themselves (a bias needs to be used)  Too high of a bias can make shadows look wrong

 Another issue with shadow maps is that the Z-buffer map may oversample some areas and undersample others  Similar to a texture that is stretched so that some is pixelated and some is far  We can change the view direction and projection so that the Z-buffer map from the lighting better matches the sampling the eye sees  More complex methods make multiple shadow maps along the view

 The shadow map technique does not, by itself, make soft shadows  Soft shadows can be achieved by sampling the four closest points in the shadow map and interpolating them together  Percentage-closer filtering tries to approximate area lighting with point lights by seeing how much of the nearby surface can see the point light

 Ambient lighting is completely even and directionless  As a consequence, objects in ambient lighting without shadows look very flat  Ambient occlusion is an attempt to add shadowing to ambient lighting

 Without taking occlusion into account, the ambient irradiance is constant:  But for points that are blocked in some way, the radiance will be less  We use the factor k A (p) to represent the fraction of the total irradiance available at point p

 The ideas used for ambient occlusion can be applied to other lighting  We could use an irradiance map to give diffuse lighting that is both directed and diffuse  As the figure shows, we can weight the surface normals based on visibility to produce a bent normal  We then use the bent normal for doing lookups in the irradiance map

 The trick, of course, is how to compute k A  The visibility function approach checks to see if a ray cast from a direction intersects any other object before reaching a point  We average over all (or many) directions to get the final value  Doesn't work (without modifications) for a closed room  Obscurance is similar, except that it is based on the distance of the intersection of the ray cast, not just whether or not it does

 Generally, ambient occlusion makes the shadows darker than they should be  In a real global illumination situation, objects interreflect, redirecting light onto surfaces that are otherwise blocked  One way to simulate this is by changing the k A term:

 In static scenes, k A and bent normal n bent can be precomputed  For dynamic scenes, it must be done on the fly  There are object space methods that involve casting rays from every vertex to every other vertex to determine intersections  Optimizations can be done that divide the screen up into hierarchies

 Screen space ambient occlusion methods have become popular in recent video games such as Crysis and StarCraft 2  Scene complexity isn't an issue  In Crysis, sample points around each point are tested against the Z-buffer  More points that are behind the visible Z –buffer give a more occluded point  A very inexpensive technique is to use an unsharp mask (a filter that emphasizes edges) on the Z-buffer, and use the result to darken the image

 Reflection  Transmittance  Refraction  Caustics  Subsurface scattering

 Keep working on Project 3  Due by midnight next Thursday  Keep reading Chapter 9