Shadow and Environment Maps

Similar documents
To Do. Advanced Computer Graphics. Real-Time Rendering. Motivation. Offline 3D Graphics Rendering. Evolution of 3D graphics rendering

Analysis of Planar Light Fields from Homogeneous Convex Curved Surfaces Under Distant Illumination

Advanced Shading I: Shadow Rasterization Techniques

03 RENDERING PART TWO

Motivation. My General Philosophy. Assumptions. Advanced Computer Graphics (Spring 2013) Precomputation-Based Relighting

Real-Time Shadows. Computer Graphics. MIT EECS Durand 1

Real-Time Shadows. Last Time? Textures can Alias. Schedule. Questions? Quiz 1: Tuesday October 26 th, in class (1 week from today!

Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

Precomputation-Based Real-Time Rendering

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

CS-184: Computer Graphics. Administrative

Recent Advances in Monte Carlo Offline Rendering

For Intuition about Scene Lighting. Today. Limitations of Planar Shadows. Cast Shadows on Planar Surfaces. Shadow/View Duality.

Texture Mapping II. Light maps Environment Maps Projective Textures Bump Maps Displacement Maps Solid Textures Mipmaps Shadows 1. 7.

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

Shadows. Shadows. Spatial relationship between objects. Shadows as depth cue. Spatial relationship between objects

Subtractive Shadows: A Flexible Framework for Shadow Level of Detail

Shadows. Shadows. Spatial relationship between objects. Shadows as depth cue. Spatial relationship between objects

History of computer graphics

Rendering and Radiosity. Introduction to Design Media Lecture 4 John Lee

Real-Time Shadows. Last Time? Today. Why are Shadows Important? Shadows as a Depth Cue. For Intuition about Scene Lighting

Global Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Advanced Shading and Texturing

BRDF Computer Graphics (Spring 2008)

Last Time. Reading for Today: Graphics Pipeline. Clipping. Rasterization

Radiance. Radiance properties. Radiance properties. Computer Graphics (Fall 2008)

Real-Time Shadows. Last Time? Schedule. Questions? Today. Why are Shadows Important?

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

Shadow Rendering EDA101 Advanced Shading and Rendering

Global Illumination and the Rendering Equation

Texture. Detail Representation

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Computer Graphics. Lecture 10. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura 12/03/15

Last Time. Why are Shadows Important? Today. Graphics Pipeline. Clipping. Rasterization. Why are Shadows Important?

Shadows. Shadows. Thanks to: Frédo Durand and Seth Teller MIT. Realism Depth cue

PantaRay: Fast Ray-traced Occlusion Caching of Massive Scenes J. Pantaleoni, L. Fascione, M. Hill, T. Aila

Real-Time Shadows. MIT EECS 6.837, Durand and Cutler

Overview. Radiometry and Photometry. Foundations of Computer Graphics (Spring 2012)

Acknowledgement: Images and many slides from presentations by Mark J. Kilgard and other Nvidia folks, from slides on developer.nvidia.

Chapter 1 Introduction

Image-Based Rendering and Light Fields

DEFERRED RENDERING STEFAN MÜLLER ARISONA, ETH ZURICH SMA/

Intro to Ray-Tracing & Ray-Surface Acceleration

The Light Field and Image-Based Rendering

Thesis Report. Thesis Title: Soft Shadow Rendering in Real Time. Shihab Rezwan Manzur ID: CSE Department BRAC University

Chapter 7. Conclusions and Future Work

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

Soft Shadows: Heckbert & Herf. Soft shadows. Heckbert & Herf Soft Shadows. Cornell University CS 569: Interactive Computer Graphics.

CSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications

Efficient Image-Based Methods for Rendering Soft Shadows. Hard vs. Soft Shadows. IBR good for soft shadows. Shadow maps

Face Relighting with Radiance Environment Maps

Lecture 17: Shadows. Projects. Why Shadows? Shadows. Using the Shadow Map. Shadow Maps. Proposals due today. I will mail out comments

Announcement. Lighting and Photometric Stereo. Computer Vision I. Surface Reflectance Models. Lambertian (Diffuse) Surface.

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

And if that 120MP Camera was cool

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Rendering Hair-Like Objects with Indirect Illumination

Local vs. Global Illumination & Radiosity

Face Relighting with Radiance Environment Maps

x ~ Hemispheric Lighting

Multi-View Soft Shadows. Louis Bavoil

EECS 487: Interactive Computer Graphics

Building a Fast Ray Tracer

lecture 18 - ray tracing - environment mapping - refraction

Precomputation-Based Rendering. Contents

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Texture. Texture Maps

Assignment #2. (Due date: 11/6/2012)

CS : Assignment 2 Real-Time / Image-Based Rendering

Development of Computer Graphics

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Real Time Rendering. CS 563 Advanced Topics in Computer Graphics. Songxiang Gu Jan, 31, 2005

Recall: Indexing into Cube Map

REYES REYES REYES. Goals of REYES. REYES Design Principles

Choosing the right course

CS 283: Assignment 3 Real-Time / Image-Based Rendering

Recovering illumination and texture using ratio images

CS4670/5760: Computer Vision

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading:

CS770/870 Spring 2017 Color and Shading

Motivation: Monte Carlo Rendering. Sampling and Reconstruction of Visual Appearance. Caustics. Illumination Models. Overview of lecture.

CSCI 4972/6963 Advanced Computer Graphics Quiz 2 Tuesday April 17, 2007 noon-1:30pm

Discussion. Smoothness of Indirect Lighting. History and Outline. Irradiance Calculation. Irradiance Caching. Advanced Computer Graphics (Spring 2013)

A Frequency Analysis of Light Transport

Motivation. Advanced Computer Graphics (Fall 2009) CS 283, Lecture 11: Monte Carlo Integration Ravi Ramamoorthi

Homework 3: Programmable Shaders

To Do. Advanced Computer Graphics. Course Outline. Course Outline. Illumination Models. Diffuse Interreflection

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Reading. 12. Texture Mapping. Texture mapping. Non-parametric texture mapping. Required. w Watt, intro to Chapter 8 and intros to 8.1, 8.4, 8.6, 8.8.

Pipeline Operations. CS 4620 Lecture 10

CS635 Spring Department of Computer Science Purdue University

Efficient Rendering of Glossy Reflection Using Graphics Hardware

Light Transport CS434. Daniel G. Aliaga Department of Computer Science Purdue University

Photometric Stereo. Lighting and Photometric Stereo. Computer Vision I. Last lecture in a nutshell BRDF. CSE252A Lecture 7

Development of Computer Graphics. mid 1950s SAGE air defense system command & control CRT, light pens

6.837 Introduction to Computer Graphics Quiz 2 Thursday November 20, :40-4pm One hand-written sheet of notes allowed

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Transcription:

CS294-13: Special Topics Lecture #8 Advanced Computer Graphics University of California, Berkeley Monday, 28 September 2009 Shadow and Environment Maps Lecture #8: Monday, 28 September 2009 Lecturer: Ravi Ramamoorthi Scribe: Aaron Hong 1 Introduction Shadows and complex lighting are an essential part of realistic rendering, however they can be computationally expensive (such as path tracing shadows). Therefore image-based methods, Shadow and Environment Mapping (See figure 1), are used to accelerate and approximate these effects in interactive real-time rendering. Shadow mapping is an old technique [Williams 78], but very widely used and developed with many extensions and implementations (Renderman). Environment mapping is also a very old technique [Blinn and Newell 76], but has only seen more use and development in recent times due to previous hardware limitations. 2 Shadow Maps There are many real-time shadow techniques. Common techniques are usually problematic and do not work for all situations. Projected planar shadows use a projective transform to render the casting object as the shadow, but this technique only works well (a) Shadow Map (b) Environment Map Figure 1: Image-based Rendering Techniques

2 CS294-13: Lecture #8 for flat surfaces. In the shadow volume technique, the light shoots rays through the vertices of the casting object to construct geometry, which volume is used to test for shadowing. Light maps are unsuitable for dynamic shadows. Finally, in general it is just hard to get everything to shadow everything right. See figure 2. (a) Projected Planar (b) Shadow Volumes (c) Light Maps (d) Hybrid Figure 2: Common Real-time Shadow Techniques However, the most common software rendering technique, shadow mapping, works effectively in many situation. Developed by Lance Williams in 1978, along with other completely image-space algorithms, the technique precomputes images to avoid retracing shadow rays for every frame. The basic idea is to take an image of what the light sees in the scene and then compare it to what the eye sees by projecting the depth back to the light. The places where it is seen by both the light and the eye we know is lit. Otherwise, it is in the shadow. See figure 3. Figure 3: Shadow Mapping The saved image from the light is called the shadow map, which is essentially a bitmap where depth corresponds to a gray scale value. See figure 4.

CS294-13: Lecture #8 3 (a) Depth Buffer from Light (b) Projecting the depth onto the eye s view Figure 4: Visualizing Shadow Mapping 2.1 Map Filtering Normal texture filtering just averages the color components, however that would be inadequate for our uses in shadow mapping. If we average the color components of a depth map we would instead get depths of things that never existed. Essentially we will be changing the position of the objects in the scene and potentially creating new surfaces. (a) GL NEAREST: blocky (b) GL LINEAR: antialiased Figure 5: Low shadow map resolution used to heighten filtering artifacts. Instead another method is used called percentage closer filtering [Reeves 87], where the hardware takes multiple samples and then averages the results of the comparisons to get a percentage seen value. This provides anti-aliasing at shadow map edges and can be used to fake soft shadows. See figure 5.

4 CS294-13: Lecture #8 Figure 6: Green is where the light planar distance and the light depth map are approximately equal. Note the aliasing due to the tolerance. 2.2 Limitations Although shadow maps are one of the most viable real-time shadow techniques, it still has it s limitations. One, it is generally only applicable to point lights and produces hard shadows. The quality of the shadow also depends on the resolution of the shadow map. Extreme angles or low resolutions reveal aliasing effects. Finally, there is equality comparisons of floating point depth values which means there are issues of scale, bias, and tolerance (See figure 6). There however have been many extension including adaptive sampling. 3 Environment Maps Environment maps are a way of creating and using complex lighting through the use of images. The idea was conceived as early as 1976 when Blinn and Newell demonstrated reflection maps (See figure 7a). Horn contributed the reflectance maps in 1977. Miller and Hoffman are other major contributors, who developed irradiance and Phong reflection maps (See figure 7c). There has been abundant development in recent years, including work from Paul Debevec, who has contributed his famous high dynamic range environment maps including the Eucalyptus Grove and Grace Cathedral. Since environment maps are by nature an image, it also makes sense to collect environment maps from the real world through photographs and different techniques (See figure 7b). We will see how we can sample an environment map in a few lectures from

CS294-13: Lecture #8 5 now. First we will talk about irradiance environment maps, which be used to light diffuse surfaces. (a) Reflection Map (b) Ornament used to capture map. (c) Composited image with 3D element using a environment map Figure 7: Environment Map 3.1 Irradiance Environment Map Some assumptions we will make for lighting using the environment map is that the surface of the object is diffuse. Also the illumination is distant, so that the lighting can generalize to all points on the surface of an object. Finally, there is no shadowing or interreflection. Hence, irradiance is a function of the surface normal. The diffuse reflection equation is just the reflectance ρ times the irradiance E equals the radiosity B (See figure 8). Figure 8: Diffuse Equation There is another property of diffuse surfaces we can exploit in order to do real-time rendering, which is a diffuse surface acts like a low pass filter. We will use an analytic expression for the irradiance in terms of spherical harmonic coefficients (See figure 9) of the lighting to approximate diffuse surfaces [Ramamoorthi and Hanrahan 01].

6 CS294-13: Lecture #8 Definition 1. Analytic Irradiance Formula E lm = A l L lm (1) ( 1) 1 2 1 [ ] l! A l = 2π (l + 2)(l 1) 2 l ( 1 2!)2 (2) Figure 9: Graph of Irradiance Approximation Since it acts like a low pass filter, we only need to use the lowest-frequency modes of illumination, which corresponds to using only 9 spherical harmonic coefficients. For any illumination, on average the error is less than 3% [Basri and Jacobs 01]. See figure 10. (a) Exact image (b) Order 2 with 9 Terms (c) Spherical harmonics Figure 10: 9 Parameter Approximation This can be written as a simple procedural method, which makes it easy for rendering either in software or hardware because it only requires matrix-vector multiplication and a dot product. Due to it s simplicity, it is widely implemented and used in games (AMPED for Microsoft Xbox) and movies (Pixar and Framestore CFC). Definition 2. Irradiance Approximation in Matrix Form E(n) = n t Mn (3)

CS294-13: Lecture #8 7 4 Conclusion Both Shadow Mapping and Environment Mapping are popular methods used for realtime rendering. However, each have their own limitations and do not account for all visual effects. A combination of both methods give many of the realistic effects we want, but ultimately is a non-trivial problem. For more information about rendering shadows from sampling environment maps see Ben-Artzi and Ramamoorthi 2004. There have been many extensions to do more advance effects, but they still exist today in there venerable forms. References [1] Lance Williams, Casting Curved Shadows on Curved Surfaces. Proc. Siggraph 78, Computer Graphics, pp. 270-274, August 1978. [2] James F. Blinn, Martin E. Newell, Texture and reflection in computer generated images. Communications of the ACM, v.19 n.10, p.542-547, Oct. 1976 [3] Reeves, W.T., Salesin, D. H., and Cook, R. I., Rendering Antialiased Shadows with Depth Maps. Proc. Siggraph 87, Computer Graphics, pages 283-291, July 1987. [4] Ramamoorthi, Ravi and Hanrahan, Pat, A signal-processing framework for reflection. ACM Trans. Graph., v.23 n.4, p.1004-1042, 2004 [5] Basri, R. and Jacobs, D., Photometric stereo with general, unknown lighting. IEEE International Conference on Computer Vision, Kauai, II:374-381. 2004