real-time high quality rendering cse 291 [winter 2015], lecture 3 shadow and environment mapping...
TRANSCRIPT
![Page 1: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/1.jpg)
Real-Time High Quality Rendering
CSE 291 [Winter 2015], Lecture 3
Shadow and Environment Mapping
http://www.cs.ucsd.edu/~ravir
![Page 2: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/2.jpg)
To Do
By Thu night, e-mail me brief project description (can be done in groups of 2). Time to discuss next week
A good idea is to choose to present papers relating to your intended project and vice-versa.
This lecture discusses shadow and environment mapping
Remember: Jan 15 student presentations of papers
Jan 20: no class (Siggraph deadline)
![Page 3: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/3.jpg)
Shadow and Environment Maps Basic methods to add realism to interactive rendering
Shadow maps: image-based way hard shadows Very old technique. Originally Williams 78 Many recent (and older) extensions Widely used even in software rendering (RenderMan) Simple alternative to raytracing for shadows
Environment maps: image-based complex lighting Again, very old technique. Blinn and Newell 76 Huge amount of recent work (some covered in course)
Together, give most of realistic effects we want But cannot be easily combined!! Some of the course is
about ways to get around this limitation See Annen 08 [real-time all-frequency shadows dynamic
scenes] for one approach: convolution soft shadows
![Page 4: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/4.jpg)
Common Real-time Shadow Techniques
Shadowvolumes
Light maps
Projectedplanarshadows
Hybridapproaches
This slide, others courtesy Mark Kilgard
![Page 5: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/5.jpg)
Problems
Mostly tricks with lots of limitations
Projected planar shadowsworks well only on flat surfaces
Stenciled shadow volumesdetermining the shadow volume is hard work
Light mapstotally unsuited for dynamic shadows
In general, hard to get everything shadowing everything
![Page 6: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/6.jpg)
Shadow Mapping
Lance Williams: Brute Force in image space (shadow maps in 1978, but other similar ideas like Z buffer, bump mapping using textures and so on)
Completely image-space algorithm no knowledge of scene’s geometry is required must deal with aliasing artifacts
Well known software rendering technique Basic shadowing technique for Toy Story, etc.
![Page 7: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/7.jpg)
Phase 1: Render from Light
Depth image from light source
![Page 8: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/8.jpg)
Phase 1: Render from Light
Depth image from light source
![Page 9: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/9.jpg)
Phase 2: Render from Eye
Standard image (with depth) from eye
Eye
![Page 10: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/10.jpg)
Phase 2+: Project to light for shadows
Project visible points in eye view back to light source
Eye
(Reprojected) depths match for light and eye. VISIBLE
![Page 11: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/11.jpg)
Phase 2+: Project to light for shadows
Eye
(Reprojected) depths from light, eye not the same. BLOCKED!!
Project visible points in eye view back to light source
![Page 12: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/12.jpg)
Visualizing Shadow Mapping
A fairly complex scene with shadows
the pointlight source
![Page 13: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/13.jpg)
Visualizing Shadow Mapping
Compare with and without shadows
with shadows without shadows
![Page 14: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/14.jpg)
Visualizing Shadow Mapping
The scene from the light’s point-of-view
FYI: from theeye’s point-of-viewagain
![Page 15: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/15.jpg)
Visualizing Shadow Mapping
The depth buffer from the light’s point-of-view
FYI: from thelight’s point-of-viewagain
![Page 16: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/16.jpg)
Visualizing Shadow Mapping
Projecting the depth map onto the eye’s view
FYI: depth map forlight’s point-of-viewagain
![Page 17: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/17.jpg)
Visualizing Shadow Mapping
Comparing light distance to light depth map
Green is where the
light planar distance and
the light depth map
are approximatel
y equal
Non-green is where shadows should be
![Page 18: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/18.jpg)
Visualizing Shadow Mapping
Scene with shadows
Notice how specular
highlights never appear
in shadows
Notice how curved surfaces cast shadows on each other
![Page 19: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/19.jpg)
Hardware Shadow Map Filtering
“Percentage Closer” filtering Normal texture filtering just averages color components Averaging depth values does NOT work Solution [Reeves, SIGGARPH 87]
Hardware performs comparison for each sample Then, averages results of comparisons
Provides anti-aliasing at shadow map edges Not soft shadows in the umbra/penumbra sense
![Page 20: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/20.jpg)
Hardware Shadow Map Filtering
GL_NEAREST: blocky GL_LINEAR: antialiased edges
Low shadow map resolutionused to heighten filtering artifacts
![Page 21: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/21.jpg)
Problems with shadow maps
Hard shadows (point lights only)
Quality depends on shadow map resolution (general problem with image-based techniques)
Involves equality comparison of floating point depth values means issues of scale, bias, tolerance
Some of these addressed in papers presented
![Page 22: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/22.jpg)
Reflection Maps
Blinn and Newell, 1976
![Page 23: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/23.jpg)
Environment Maps
Miller and Hoffman, 1984
![Page 24: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/24.jpg)
Environment Maps
Interface, Chou and Williams (ca. 1985)
![Page 25: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/25.jpg)
Environment Maps
Cubical Environment Map180 degree fisheyePhoto by R. Packo
Cylindrical Panoramas
![Page 26: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/26.jpg)
Reflectance Maps
Reflectance Maps (Index by N)
Horn, 1977
Irradiance (N) and Phong (R) Reflection Maps
Miller and Hoffman, 1984
Mirror Sphere Chrome SphereMatte Sphere
![Page 27: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/27.jpg)
Irradiance Environment Maps
Incident Radiance(Illumination Environment Map)
Irradiance Environment Map
R N
![Page 28: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/28.jpg)
Assumptions
Diffuse surfaces
Distant illumination
No shadowing, interreflection
Hence, Irradiance a function of surface normal
![Page 29: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/29.jpg)
Diffuse Reflection
B ERadiosity
(image intensity)Reflectance
(albedo/texture)Irradiance
(incoming light)
×=
quake light map
![Page 30: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/30.jpg)
Analytic Irradiance Formula
Lambertian surface acts like low-pass filter
lA
2 / 3
/ 4
0
l0 1 2
Ramamoorthi and Hanrahan 01Basri and Jacobs 01
![Page 31: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/31.jpg)
9 Parameter Approximation
-1-2 0 1 2
0
1
2
Order 01 term
RMS error = 25 %
Exact image
![Page 32: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/32.jpg)
9 Parameter Approximation
-1-2 0 1 2
0
1
2
Exact imageOrder 14 terms
RMS Error = 8%
![Page 33: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/33.jpg)
9 Parameter Approximation
-1-2 0 1 2
0
1
2
Exact imageOrder 29 terms
RMS Error = 1%
For any illumination, average error < 3% [Basri Jacobs 01]
![Page 34: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/34.jpg)
Real-Time Rendering
Simple procedural rendering method (no textures) Requires only matrix-vector multiply and dot-product In software or NVIDIA vertex programming hardware
Widely used in Games (AMPED for Microsoft Xbox), Movies (Pixar, Framestore CFC, …)
![Page 35: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/35.jpg)
Environment Map Summary
Very popular for interactive rendering
Extensions handle complex materials
Shadows with precomputed transfer
But cannot directly combine with shadow maps
Limited to distant lighting assumption
![Page 36: Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping ravir](https://reader035.vdocuments.site/reader035/viewer/2022062712/56649c9f5503460f9495f1e8/html5/thumbnails/36.jpg)
Resources
OpenGL red book (latest includes GLSL)
Web tutorials: http://www.lighthouse3d.com/opengl/glsl/
Older books: OpenGL Shading Language book (Rost), The Cg Tutorial, …
http://www.realtimerendering.com Real-Time Rendering by Moller and Haines
Debevec http://www.debevec.org/ReflectionMapping/ Links to Miller and Hoffman original, Haeberli/Segal
http://www.cs.berkeley.edu/~ravir/papers/envmap Also papers by Heidrich, Cabral, …
Lots of information available on web…