Understanding volumetric lighting in Eevee

Couple of days ago I had started learning Volumetric Lighting in Eevee (and blogged about it as well). Although I got a basic understanding of the volumetric lighting workflow, I really wanted to understand how the system worked.


Experimentation

I setup a simple scene to understand Volumetrics in Eevee and also wrote a simple Blender Python operator to make my experimentation streamlined. Following is the UI presented to me after the operator is invoked.

The main idea is to visually understand the sampling of volumetric lighting and shadows by adjusting the parameters.

You can see my Eevee volumetrics study in action in the video below.

Learning Blender 2.80+ : Understanding Volumetric Lighting in Eevee

I intend to study this further and then create a user centric tutorial with examples.

Research

Thanks to Blender being an Open Source project, I then consulted Eevee source code to better understand volumerics implementation in Blender's Eevee rendering engine. I looked at the following files so far.

source/blender/draw/engines/eevee/eevee_volumes.c
source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl
source/blender/draw/engines/eevee/shaders/volumetric_geom.glsl
source/blender/draw/engines/eevee/shaders/volumetric_vert.glsl
source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl
source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl
source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl
source/blender/draw/engines/eevee/shaders/volumetric_resolve_frag.glsl

Notes

Eevee's volumetric lighting and rendering is based on Frostbite Unified Volumetric Rendering
After the initialization is done, following is the processing pipeline for Volumetrics in Eevee (The following bulletted items are taken directly from the source code)
  • Evaluate all light scattering for each froxels. Also do the temporal reprojection to fight aliasing artifacts.
  • Integrate for each froxel the final amount of light scattered back to the viewer and the amount of transmittance.
  • Apply final integration on top of the scene color.

References

Thank you for visiting my blog and reading this blog post. If you have any suggestions and comments, please add a comment to this post.
-------------------
Satish Goda
@satishgoda

Comments

Popular Posts