SH experiments continued

My first spherical harmonics experiments were quite interesting ! I managed to include them in production quite quickly, in the form of irradiance volumes.

I currently use a set of volume textures to encode 3rd order RGB SH coefficients. This allowed me quickly have a convincing diffuse lighting on the animated entities in my project. As the lighting in smooth enough, the SH encodes both direct & indirect lighting with good enough results.

I also experimented with SH for other purposes :
  • obtaining convincing specular colors. The preliminary results were interesting but I lacked time to properly integrate this feature.
  • obtaining lighting for volumetric lighting effects. While I managed to have some nice atmospheric effects, this method is not directly applicable to reconstruct clearly visible "light beams". Moreover, the ray marching code in fragment shader is quite costly, so for now, I discarded it.
  • lighting vegetation planes. This is a nasty hack, but the vegetation now have a subtle view dependent lighting that contributes to reduce a tiling effect ; and the vegetation now better integrates with surrounding geometry.
I'm quite happy with the possibilities lying ahead !


Anonymous said...

How many irradiance volumes do you use? How big are they? What's the memory consumption? Do you use hw 3d texture fetching?

rotoglup said...

I did use one volume per room in a very tight environment - it lead to about 10 volumes.

The sampling of each volume was made at fixed rate, at about 1-4 texel per meter. The biggest 3d texture is 64x128x16. All the textures consume about 6Mb of memory.

I effectively used hw 3d texture fetching.

The environment was tight, so I did not have to use a hierarchical irradiance volume storage system.