Volumetric Lighting - Update3
Volumetric Light Scattering using Post Process Shaders
After looking at algorithms from the Ubisoft paper and NVIDIA’s GDC talk, I was able to understand more about the complexity involved in generating volumetric lighting. The above two papers goes a high level on how they implemented the algorithm with the math behind the calculations. These proved rather challenging to me and any examples that came with them are in DirectX 11 and fairly complicated.
Since I am new to rendering and I wanted to prototype something quick, I started looking at more examples and preferrably into OpenGL implementations. After looking at lot of examples and articles, I found this blog which mentions a technique using 3 step rendering to create volumetric lights in OpenGL. This method achieves volumetric lighting using the following steps:
- Generate a texture and frame buffer for a shadow map(which is nothing but a depth map)
- Generate a texture and frame buffer for an occlusion map
- Generate a texure and frame buffer for a scene render target.
- Per frame do the folloing steps:
- Draw the shadow map
- Draw the occlusion map
- Draw the scene render target
- Blend the occlusion map and scene render and display it on the screen