Environment Mapping CSE 781 – Roger Crawfis

Slides:



Advertisements
Similar presentations
Spherical Harmonic Lighting Jaroslav Křivánek. Overview Function approximation Function approximation Spherical harmonics Spherical harmonics Some other.
Advertisements

Real-time Shading with Filtered Importance Sampling
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Computer graphics & visualization Global Illumination Effects.
Real-Time Rendering Self-Shadowing
Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping
Spherical Convolution in Computer Graphics and Vision Ravi Ramamoorthi Columbia Vision and Graphics Center Columbia University SIAM Imaging Science Conference:
Spherical Harmonic Lighting of Wavelength-dependent Phenomena Clifford Lindsay, Emmanuel Agu Worcester Polytechnic Institute (USA)
Frequency Domain Normal Map Filtering Charles Han Bo Sun Ravi Ramamoorthi Eitan Grinspun Columbia University.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
Advanced Computer Graphics
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 21: Radiometry Many slides courtesy Pat Hanrahan.
Advanced Computer Graphics (Spring 2013) CS 283, Lecture 8: Illumination and Reflection Many slides courtesy.
Rendering with Environment Maps Jaroslav Křivánek, KSVI, MFF UK
Week 9 - Wednesday.  What did we talk about last time?  Fresnel reflection  Snell's Law  Microgeometry effects  Implementing BRDFs  Image based.
Computer graphics & visualization Pre-Computed Radiance Transfer PRT.
Based on slides created by Edward Angel
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of New Mexico
A Signal-Processing Framework for Inverse Rendering Ravi Ramamoorthi Pat Hanrahan Stanford University.
A Signal-Processing Framework for Forward and Inverse Rendering COMS , Lecture 8.
An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi Pat Hanrahan Stanford University.
Real-Time Rendering COMS , Lecture 9. Real-Time Rendering Demo Motivation: Interactive rendering with complex natural illumination and realistic,
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Computer Graphics (Spring 2008) COMS 4160, Lecture 20: Illumination and Shading 2
A Signal-Processing Framework for Forward and Inverse Rendering Ravi Ramamoorthi Ravi Ramamoorthi
A Signal-Processing Framework for Forward and Inverse Rendering Ravi Ramamoorthi Ph.D. Orals: June 3, 2002.
Computer Graphics (Fall 2008) COMS 4160, Lecture 19: Illumination and Shading 2
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Real-Time High Quality Rendering COMS 6160 [Fall 2004], Lecture 4 Shadow and Environment Mapping
7M836 Animation & Rendering
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
A Signal-Processing Framework for Forward and Inverse Rendering Ravi Ramamoorthi Stanford University Columbia University: Feb 11, 2002.
Computer Graphics (Fall 2004) COMS 4160, Lecture 16: Illumination and Shading 2 Lecture includes number of slides from.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
CS 445 / 645: Introductory Computer Graphics
1 Texturing. 2 What is Texturing? 3 Texture Mapping Definition: mapping a function onto a surface; function can be:  1, 2, or 3D  sampled (image) or.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
Shading / Light Thanks to Srinivas Narasimhan, Langer-Zucker, Henrik Wann Jensen, Ravi Ramamoorthi, Hanrahan, Preetham.
Efficient Irradiance Normal Mapping Ralf Habel, Michael Wimmer Institute of Computer Graphics and Algorithms Vienna University of Technology.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
Real-Time Rendering Digital Image Synthesis Yung-Yu Chuang 01/03/2006 with slides by Ravi Ramamoorthi and Robin Green.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi Pat Hanrahan Stanford University SIGGRAPH 2001 Stanford University SIGGRAPH.
Real-Time Relighting Digital Image Synthesis Yung-Yu Chuang 1/10/2008 with slides by Ravi Ramamoorthi, Robin Green and Milos Hasan.
Real-time Shading with Filtered Importance Sampling Jaroslav Křivánek Czech Technical University in Prague Mark Colbert University of Central Florida.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Lighting affects appearance. How do we represent light? (1) Ideal distant point source: - No cast shadows - Light distant - Three parameters - Example:
Quick survey about PRT Valentin JANIAUT KAIST (Korea Advanced Institute of Science and Technology)
Announcements Office hours today 2:30-3:30 Graded midterms will be returned at the end of the class.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics (Spring 2003) COMS 4160, Lecture 18: Shading 2 Ravi Ramamoorthi Guest Lecturer: Aner Benartzi.
Spherical Harmonics in Actual Games
Cornell CS465 Spring 2004 Lecture 4© 2004 Steve Marschner 1 Shading CS 465 Lecture 4.
Non-Linear Kernel-Based Precomputed Light Transport Paul Green MIT Jan Kautz MIT Wojciech Matusik MIT Frédo Durand MIT Henrik Wann Jensen UCSD.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
Lighting and Reflection Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Texture Coordinates CS418 Computer Graphics John C. Hart.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Advanced Computer Graphics
Shading CS 465 Lecture 4 © 2004 Steve Marschner • 1.
Advanced Computer Graphics
Real-time environment map lighting
Chapter XVI Texturing toward Global Illumination
Presentation transcript:

Environment Mapping CSE 781 – Roger Crawfis

Natural illumination People perceive materials more easily under natural illumination than simplified illumination. Images courtesy Ron Dror and Ted Adelson

Natural illumination Natural illumination is very expensive compared to using simplified illumination (take CSE 782). directional source natural illumination

Environment Mapping Determine reflected ray. Look-up direction from a sphere-map. Reflection only depends on the direction, not the position.

Environment Mapping We can also encode the reflected directions using several other formats. Greene, et al suggested a cube. This has the advantage that it can be constructed by six normal renderings.

Environment Mapping Create six views from the shiny object’s centroid. When scan-converting the object, index into the appropriate view and pixel. Use reflection vector to index. Largest component of reflection vector will determine the face.

Environment Mapping Problems: Reflection is about object’s centroid. Okay for small objects and and distant reflections. N N

Environment Mapping Latitude/Longitude Too much distortion at poles Makes rate of change from spherical to image vary greatly as a distance from the pole

Environment Mapping Cube Maps Can be created with GPU Low distortion Decimation/reconstruction is non-spherical (i.e. per face) causing filter region to

Environment Mapping Cube Mapping

Sphere Mapping

Indexing Sphere Maps Given the reflection vector R (s,t) on the spherical map Problems: Highly non-uniform sampling Highly non-linear mapping

Non-linear Mapping Linear interpolation of texture coordinates picks up the wrong texture pixels Use small polygons! Correct Linear

Sphere Mapping Can be easily created by photographing a mirrored sphere.

Sphere Mapping Miller and Hoffman, 1984

Sphere Mapping Example

Parabolic Mapping Dual Paraboloid Error Support Region Use because cube maps cause seams artifacts when using MIP-maps Support Region

Parabolic Mapping

Environment Mapping Applications Specular highlights Multiple light sources Reflections for shiny surfaces Irradiance for diffuse surfaces

Specular Highlights Sphere map on top Result in the middle Standard OpenGL lighting on the bottom. Not needed with fragment shaders, … unless … Still a nice technique for many lights. View dependent.

Chrome Mapping Cheap environment mapping Material is very glossy, hence perfect reflections are not seen. Index into a pre-computed view independent texture. Reflection vectors are still view dependent.

Chrome Mapping Usually, we set it to a very blurred landscape image. Brown or green on the bottom White and blue on the top. Normals facing up have a white/blue color Normals facing down on average have a brownish color.

Chrome Mapping Also useful for things like fire. The major point, is that it is not important what actually is shown in the reflection, only that it is view dependent.

Diffuse Reflection = × radiosity (image intensity) reflectance (albedo/texture) irradiance (incoming light) = × quake light map

Lambertian Surface Diffuse Scattering specular reflection Light everywhere diffuse reflection

2-Color Hemi-sphere Model The 2-color hemi-sphere model from Lab1 was a very simple environment map for diffuse reflection. Sky Color q Ground Color

Model Elements Sky Color Ground Color Hemisphere Model Final Color

Distributed Light Model Hemisphere of possible incident light directions q Surface Normal Microfacet Normal - defines axis of hemisphere

Irradiance environment maps L n Illumination Environment Map Irradiance Environment Map

Example Hemi-sphere Map Environment map (longitude/latitude) Irradiance map

Cube Map And Its Integral

Spherical Harmonics Roger Crawfis CSE 781

Basis functions Basis Functions are pieces of signal that can be used to produce approximations to a function

Basis functions We can then use these coefficients to reconstruct an approximation to the original signal

Basis functions We can then use these coefficients to reconstruct an approximation to the original signal

Orthogonal Basis Functions These are families of functions with special properties

Orthogonal Basis Functions Space to represent data Different spaces often allow for compression of coefficients Lets look at one simple example of the following piece of data Data

Orthogonal Basis Functions Standard Basis Coefficient for each discrete position

DCT Discrete Cosine Transform Use Cosine waves as basis functions cos x 1 cos 2x cos 3x

Function Reconstruction with DCT k cos x 0.15 + 0.25 = = - 0.3 cos 3x

Function Reconstruction with DCT Only needed 3 coefficients instead of 20! Remaining coefficients are all 0 Most of the time data not perfect Obtain good reconstruction from few coefficients Arbitrary function conversion requires projection

Real spherical harmonics

Reading SH diagrams This direction + – Not this direction

Reading SH diagrams This direction + – Not this direction

The SH functions

The SH functions

Spherical harmonics m l 1 2 -2 -1 1 2

Examples of reconstruction Displacement mapping on the sphere

An example Take a function comprised of two area light sources SH project them into 4 bands = 16 coefficients

Low frequency light source We reconstruct the signal Using only these coefficients to find a low frequency approximation to the original light source

SH lighting for diffuse objects An Efficient Representation for Irradiance Environment Maps, Ravi Ramamoorthi and Pat Hanrahan, SIGGRAPH 2001 Assumptions Diffuse surfaces Distant illumination No shadowing, interreflection irradiance is a function of surface normal

Spherical harmonic expansion Expand lighting (L), irradiance (E) in basis functions = .67 + .36 + …

Analytic irradiance formula Lambertian surface acts like low-pass filter 1 2 cosine term

9 parameter approximation Order 0 1 term Exact image -1 -2 1 2 l m RMS error = 25 %

9 Parameter Approximation Order 1 4 terms Exact image -1 -2 1 2 l m RMS Error = 8%

9 Parameter Approximation Order 2 9 terms Exact image -1 -2 1 2 l m RMS Error = 1% For any illumination, average error < 3% [Basri Jacobs 01]

Comparison Incident illumination 300x300 Irradiance map Texture: 256x256 Hemispherical Integration 2Hrs Irradiance map Texture: 256x256 Spherical Harmonic Coefficients 1sec

Rendering Irradiance approximated by quadratic polynomial 4x4 matrix (depends linearly on coefficients Llm) Surface Normal vector column 4-vector

matrix form M = c1L22 c1L2-2 c1L21 c2L11 -c1L22 c1L2-1 c2L1-1 c3L20

Complex geometry Assume no shadowing: Simply use surface normal

Cool!

Diffuse environment shading Need integration over environment map For diffuse reflection scaled by cosinus Index in filtered versions of map specular reflection diffuse reflection received radiance is function of accessability ambient occlusion IN4151 Introduction 3D graphics

A Skin Texture Shader Skin appears softer than Lambertian reflectance because of subsurface scattering Seeliger lighting model I = (N L) / (N L + N V ) Implement as a texture shader s = N L t = N V C = s/(s+t )