1 / 25

CS361

Week 9 - Wednesday. CS361. Last time. What did we talk about last time? Fresnel reflection Snell's Law Microgeometry effects Implementing BRDFs Image based rendering. Questions?. Project 3. Area Lighting. Area lighting.

koen
Download Presentation

CS361

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Week 9 - Wednesday CS361

  2. Last time • What did we talk about last time? • Fresnel reflection • Snell's Law • Microgeometry effects • Implementing BRDFs • Image based rendering

  3. Questions?

  4. Project 3

  5. Area Lighting

  6. Area lighting • So far, we have only been talking about lighting as coming from a particular source • Lighting like that happens mostly in space • On earth, area lighting has a huge impact • Sky light from the sun's light scattering through the atmosphere • Indoor lighting is usually indirect (because a bare bulb hurts the eyes)

  7. Area light sources • Area lights are complex • The book describes the 3D integration over a hemisphere of angles needed to properly quantify radiance • No lights in reality are point lights • All lights have an area that has some effect

  8. Ambient light • The simplest model of indirect light is ambient light • This is light that has a constant value • It doesn't change with direction • It doesn't change with distance • Without modeling occlusion (which usually ends up looking like shadows) ambient lighting can look very bad • We can add ambient lighting to our existing BRDF formulation with a constant term:

  9. Student Lecture: Environment Mapping

  10. Environment Mapping

  11. Environment mapping • A more complicated tool for area lighting is environment mapping (EM) • The key assumption of EM is that only direction matters • Light sources must be far away • The object does not reflect itself • In EM, we make a 2D table of the incoming radiance based on direction • Because the table is 2D, we can store it in an image

  12. Mirror reflection • The radiance reflected by a mirror is based on the reflected view vector r = 2(n•v)n – v • The reflectance equation is: where RF is the Fresnel reflectance and Li is the incoming radiance from vector r

  13. EM algorithm • Steps: • Generate or load a 2D image representing the environment • For each pixel that contains a reflective object, compute the normal at the corresponding location on the surface • Compute the reflected view vector from the view vector and the normal • Use the reflected view vector to compute an index into the environment map • Use the texel for incoming radiance

  14. Problems with EM • It doesn't work well with flat surfaces • The direction doesn't vary much, mapping a lot of the surface to a narrow part of the environment map • Normal mapping combined with EM helps a lot • The range of values in an environment map may be large (to cover many light intensities) • As a consequence, the space requirements may be higher than normal textures

  15. Blinn and Newell's method • Blinn and Newell used a longitude/latitude system with a projection like Mercator •  is longitude and goes from 0 to 2π •  is latitude and goes from 0 to π • We can compute these from the normalized reflected view vector: •  = arccos(-rz) •  = atan2(ry, rx) • Problems • There are too many texels near the poles • The seam of the left and the right halves cannot easily be interpolated across

  16. Sphere mapping • Imagine the environment is viewed through a perfectly reflective sphere • The resulting sphere map (also called a light probe) is what you'd see if you photographed such a sphere (like a Christmas ornament) • The sphere map has a basis giving its own coordinate system (h,u,f) • The image was generated by looking along the f axis, with h to the right and u up (all normalized)

  17. Sphere mapping continued • To use the sphere map, convert the surface normal n and the view vector v to the sphere space by multiplying by the following matrix: • Sphere mapping only shows the environment on the front of the sphere • It is view dependent

  18. Cubic environmental mapping • Cubic environmental mapping is the most popular current method • Fast • Flexible • Take a camera, render a scene facing in all six directions • Generate six textures • For each point on the surface of the object you're rendering, map to the appropriate texel in the cube

  19. Pros and cons of cubic mapping • Pros • Fast, supported by hardware • View independent • Shader Model 4.0 can generate a cube map in a single pass with the geometry shader • Cons • It has better sampling uniformity than sphere maps, but not perfect (isocubes improve this) • Still requires high dynamic range textures (lots of memory) • Still only works for distant objects

  20. Glossy reflections • We have talked about using environment mapping for mirror-like surfaces • The same idea can be applied to glossy (but not perfect) reflections • By blurring the environment map texture, the surface will appear rougher • For surfaces with varying roughness, we can simply access different mipmap levels on the cube map texture

  21. Irradiance environment mapping • Environment mapping can be used for diffuse colors as well • Such maps are called irradiance environment maps • Because the viewing angle is not important for diffuse colors, only the surface normal is used to decide what part of the irradiance map is used

  22. Quiz

  23. Upcoming

  24. Next time… • Global illumination basics

  25. Reminders • Keep reading Chapter 8 • Start reading Chapter 9

More Related