2017년 5월 1일 월요일

Volumetric Fog

I implemented volumetric fog using Bart's method(screen aligned voxel & CS) before.



And a few days ago UE 4.16 preview seems to have volumetric fog feature which is exactly same method I used. I frustrated a little for a while(maybe 5 minutes :) ). but I was somehow proud of this event because they had chosen same algorithm at least.

Anyway, this method is easy to implement, quality is good, and performance is ready to use.

https://bartwronski.com/publications/

The idea is simple.

1. Convert Cascade Shadow Map into "Exponential Shadow Map"
2. Inject Sun Lighting(including shadow) into Voxel.
3. Scatter 2D along depth using 2D Compute Shader.

There were several difficulties(ex : ESM Blur should be different among CSM cascades),
but Implementation is intuitive in overall. If you use In-house game engine, it would be worth to implement this. If you use UE4, check out 4.16 preivew.