Download
lighting n.
Skip this Video
Loading SlideShow in 5 Seconds..
Lighting PowerPoint Presentation

Lighting

3 Views Download Presentation
Download Presentation

Lighting

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Lighting

  2. Lights

  3. Also in Unity: Emissive Materials

  4. Elements of Illumination at a point N – The surface normal L – Vector to the light V – Vector to the eye R – Reflection direction

  5. Reflection Amount of light reflected to the eye Objects the same “color” may reflect light very differently This consists of several components…

  6. Types of Light • Ambient • Diffuse • Specular • Emissive

  7. Ambient Illumination Small amount of light that is assumed to hit all surfaces. Simulates the idea of light bouncing around the room. Used as sunlight, or “general light” Technically, if only ambient light existed, everything would be black and white.

  8. Diffuse Reflection • Light diffuses over space • Lambert’s law: The smaller the angle of reflection, the more intense the reflected light is. • i = N·L Ө N L

  9. Diffuse Reflection • Diffuse reflection - light reflected in all directions equally (or close to equally) • Most objects have a component of diffuse reflection (other than pure specular reflection objects like mirrors) Diffuse reflection is what makes the blue ball blue!

  10. Specular Reflection • Specular reflection - If the light hits the surface and is reflected off mostly in a reflection direction, we have specular reflection. • A perfect specular object (no diffusion at all) is a mirror. • Most objects have some specular characteristics Specular reflection makes bright highlights on objects.

  11. Specular Illumination Diffuse Only Materials are assumed to have two colors: a diffuse color and a specular color. Specular Contribution

  12. Diffuse and Specular colors • Typically the colors reflected for diffuse and specular reflection are different • Diffuse – Generally the surface appearance • Specular – The color of bright highlights, often more white then the surface color Diffuse illumination is view independent. Specular illumination is view dependent.

  13. Light Source Intensity • Intensity of light source (60W bulb vs 100W bulb) • This is a multiplicative factor for the diffused light. • i = a + l(N·L)

  14. Distance Falloff • Light gets less intense with distance • Falloff distance: distance at which light is no longer visible (f) • Changes the light intensity factor (l) • l’ = l(f-d)/(f+d) • i = a+l’(N·L) d f

  15. Emissive Light

  16. Shade Maps • Way to shade textures or polygons non-uniformly • Calculate a shade map: Rectangle that covers the polygon. • Calculate blocks of shading • Draw shade on top of texture

  17. Tricks • Depth cueing: Further surfaces = fog or some other effect besides just getting dark • Fake shadows: Draw a dark circle under an object so it doesn’t look like it’s floating • MIP Mapping: Keep small versions of polygons for far-away objects

  18. Precomputed Real-time Lighting

  19. Forward Mapping • Forward mapping is what we are used to.

  20. Forward Mapping • Take each primitive • Figure out where on the screen it should appear • Also known is feed-forward

  21. Ray Tracing • Ray tracing is the “inverse” of the “forward” mapping we are used to.

  22. Ray Tracing • Also known as inverse mapping or feed-backward

  23. Ray-Tracing • Attempts to trace the paths of light that contribute to each pixel that make up a scene • Instead of computing visible surfaces, determine intensity contributions • Compute global illumination • Allows for: • Reflection • Refraction • Atmospheric effects • Shadows • Results in very realistic scenes • Used in movies, animations, cut-scenes

  24. Ray Tracing • Cast ray from camera through the view port into the scene. • From point on object, cast “shadow ray” to the light • If hits light, angle gives intensity for color. • If hits object, draw a shadow.

  25. Ray Tracing

  26. Reflective Material • If material is reflective, cast a ray in angle of reflection. • Recursively find the color at the reflected object

  27. Refractive Material • If material is not opaque, cast a refraction ray(s) through the material • Recursively find the color at the refracted object