Extended Light Maps

553 views

Published on

Talk given at GameOn 2000, London

Published in: Technology, Art & Photos
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
553
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Extended Light Maps

  1. 1. Extended Light Maps Stefan Brabec and Hans-Peter Seidel Max-Planck-Institut für Informatik Saarbrücken, Germany {brabec|hpseidel}@mpi-sb.mpg.de
  2. 2. Overview <ul><li>Motivation </li></ul><ul><li>Extended Light Maps </li></ul><ul><ul><li>Shadow Channel </li></ul></ul><ul><ul><li>Light Channel </li></ul></ul><ul><li>Example Applications </li></ul><ul><li>Conclusion & Future Work </li></ul>
  3. 3. Motivation <ul><li>Our Shadow Mapping Approach [Brabec/Heidrich `00] </li></ul><ul><ul><li>Render scene as seen by light source </li></ul></ul><ul><ul><li>Encode depth values in alpha channel </li></ul></ul><ul><ul><li>Project this texture into the final scene </li></ul></ul><ul><ul><li>Subtract depth values to determine lit pixels </li></ul></ul>
  4. 4. Motivation <ul><li>Generation of shadow map is expensive </li></ul><ul><ul><li>Whole scene must be rendered ! </li></ul></ul><ul><li>Idea: </li></ul><ul><ul><li>Do some additional calculations during generation phase (pre-computation) </li></ul></ul><ul><ul><ul><li>Utilize special hardware features, e.g. on GeForce </li></ul></ul></ul><ul><ul><ul><li>Pre-compute light-relative ‘static’ things (e.g. diffuse illumination) </li></ul></ul></ul><ul><ul><ul><li>Use as much hardware resources as available ! </li></ul></ul></ul>
  5. 5. Extended Light Maps <ul><li>Light Maps store pre-computed illumination </li></ul><ul><li>Extended Light Map </li></ul><ul><ul><li>Light Channel (RGB) </li></ul></ul><ul><ul><ul><li>Normal light map </li></ul></ul></ul><ul><ul><li>Shadow Channel (Alpha) </li></ul></ul><ul><ul><ul><li>Alpha-encoded depth values </li></ul></ul></ul>
  6. 6. Shadow Channel <ul><li>Distance to light source in alpha channel: </li></ul><ul><ul><li>Use 1D ramp texture and automatic texture coordinate generation </li></ul></ul><ul><ul><li>Use fog factor as linear distance function </li></ul></ul>
  7. 7. Light Channel <ul><li>Use RGB channel for arbitrary calculations e.g. </li></ul><ul><ul><li>OpenGL lighting </li></ul></ul><ul><ul><li>Object textures </li></ul></ul><ul><ul><li>Realistic spotlights </li></ul></ul><ul><ul><li>Special effects </li></ul></ul><ul><ul><li>Reflection mapping </li></ul></ul><ul><ul><li>Bump mapping </li></ul></ul>
  8. 8. Example Applications <ul><li>Illuminating a scene with two extended light maps </li></ul>
  9. 9. Example Applications <ul><li>Render scene as seen by light source #1 </li></ul><ul><ul><li>Apply object textures and OpenGL lighting </li></ul></ul><ul><ul><li>Use fog computation for linear z-distance function </li></ul></ul>Light Channel Shadow Channel
  10. 10. Example Applications <ul><li>Same for light source #2: </li></ul>Light Channel Shadow Channel
  11. 11. Example Applications <ul><li>Problem: </li></ul><ul><ul><li>Lighting needs to be calculated in camera space </li></ul></ul><ul><li>Solution: </li></ul><ul><ul><li>Diffuse and ambient lighting is already correct (does not depend on camera position) </li></ul></ul><ul><ul><li>Specular part needs special treatment </li></ul></ul><ul><ul><ul><li>Additional helper light source at camera position </li></ul></ul></ul><ul><ul><li>Attenuation and spotlight effect </li></ul></ul><ul><ul><ul><li>Simulate using texture mapping (better since texture maps are applied per pixel) </li></ul></ul></ul>
  12. 12. Example Applications <ul><li>Advantages: </li></ul><ul><ul><li>Faster: pre-computed illumination </li></ul></ul><ul><li>Disadvantages: </li></ul><ul><ul><li>Light channel will only be applied to lit pixels </li></ul></ul><ul><li>Final step(s): render from camera position </li></ul><ul><ul><li>Apply light channel value if pixel passes shadow test </li></ul></ul>
  13. 13. Example Applications <ul><li>Pre-computed reflection mapping </li></ul>
  14. 14. Example Applications <ul><li>First pass: </li></ul><ul><ul><li>Use color channel for environment cube map </li></ul></ul><ul><ul><li>Use alpha channel for z-distance </li></ul></ul>
  15. 15. Example Applications <ul><li>How to perform cube mapping in light source space ? </li></ul><ul><ul><li>Need correct reflection vector </li></ul></ul><ul><ul><li>Calculate in camera space: </li></ul></ul><ul><ul><ul><li>Viewing Matrix </li></ul></ul></ul><ul><ul><ul><li>Projection Matrix </li></ul></ul></ul>
  16. 16. Example Applications <ul><li>Two final passes </li></ul><ul><ul><li>Render normal scene (textures & lighting) </li></ul></ul><ul><ul><li>Apply extended light map (shadows & reflections) </li></ul></ul>
  17. 17. Conclusion <ul><li>Combined light and shadow mapping </li></ul><ul><ul><li>Benefits </li></ul></ul><ul><ul><ul><li>Better use of available hardware resources </li></ul></ul></ul><ul><ul><ul><li>Reduced number of rendering passes </li></ul></ul></ul><ul><ul><li>Problems </li></ul></ul><ul><ul><ul><li>Light channel can only be applied to lit pixels </li></ul></ul></ul><ul><ul><ul><li>High resolution textures needed for accurate shadows </li></ul></ul></ul>
  18. 18. Future Work <ul><li>Improve quality of shadows </li></ul><ul><ul><li>Filtering </li></ul></ul><ul><ul><li>Precision (currently 8 bits only) </li></ul></ul><ul><li>More light channel applications </li></ul><ul><ul><li>Bump mapping </li></ul></ul><ul><ul><li>Sophisticated lighting models </li></ul></ul>
  19. 19. Thank you ! Visit us at http://www.mpi-sb.mpg.de AG4 Computer Graphics Group

×