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

Extended Light Maps

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