Volumetric Lighting Demo, July 2008, by Nicolas Vizerie
===============================================================

1. About :
==========

This demo demonstrate a rendering effect known as 'volumetric lighting'.
It depicts the interraction of light with a participating media (example: dusty atmosphere), in a simplified fashion.
The pixel shader used to render that effect is included in the 'media' folder.


The algorithm unfolds as follow :

- A shadow map is rendered from the light points of view
- A texture containing view space coordinate of geometry is rendered (as with deffered shading)
- The spotlight cone is clipped and capped against the viewing front plane
- The spotlight cone is rendered with the volumetric lighting shader

In the shader :
- The entry point is read from the cone geometry (in view space coords)
- The exit point is read from the view space coordinate texture
- The entry and exit point are transformed (projected) into the coordinate of the shadow map
and the gobo (a projected texture : GO Before Optic)
- Depending on the wanted steps count, a step is computed to perform the traversal of the texture
- For each sample, the traversed distance is not linear! we need to deproject it to get the good distance.
 Fortunately this is very much like texture mapping : grad(dist/z) is constant along the line of sight, so we don't need
 to recomput the distance, a divide is sufficient per sample. Each sample is modulated by the valuefound in the shadow map
- The accumulated value is output by the shader

Controls : 
==========
Use arrow keys to move the camera.
Use alt-enter to toggle to fullscreen mode.
Click and hold left button in the scene to look around.
                                 

Options :
=========
Please edit scene_view_config.lua to change option such a fullscreen resolution

Hardware requirement
====================
A GPU supporting pixel shaders 3.0 is required

Version history
===============
1.0 : Initial release

Contact
=======
Nicolas Vizerie : nicovize@club-internet.fr
www.vizerie3d.net

License
=======
This demo is freeware. You may redistribute freely it as long as the whole 
package is left unmodified and complete (including this file). You may not 
sale this software. By using this software, you agree that the author should 
not be liable or responsible for any damages, injuries or liabilities caused 
directly or indirectly from the use of the software, including but not limited
to incidental, consequential or special damages.
