Simple 3D rendering pipeline with volumetric clouds/fog

During the past 7 days I was writing simple rendering pipeline for someone. Here is screenshot of the result.

If you find it interesting, here is frame anatomy (scene was made just for testing, lot of things that could be instanced / merged aren’t)

Some videos from earlier stages:

https://streamable.com/6yt2pc

Have a nice day :slight_smile:

15 Likes

I am wondering how do you get the volumetric fog to work, any tips you can share?

http://advances.realtimerendering.com/s2015/The%20Real-time%20Volumetric%20Cloudscapes%20of%20Horizon%20-%20Zero%20Dawn%20-%20ARTR.pdf this is the best paper on given topic

Thing that article doesn’t cover are shadows from geometry. For that I calculate origin position in shadow buffer UV space before start of raymarch. As well as march direction and ratio between ray step size and shadow step size (as long as shadow caster is ortho it will be linear). Then I simply move in both spaces at the same time (world space for raymrach, shadow uv for shadow tap). Alternatively you can simply do whole world space to shadow viewproj for each step.

Quite interesting paper and very long. By the way, how long does it takes to calculate and render?

I can assume that it is very light but the game area you have seems quite limited, is it because of resource constrain or game developer decision to have small chunks of map?

Nope, clouds / fog rendering is full screen pass and its price has very low dependency on a scene (at best, it can cause early ray extinction, ending raymarch early). On ancient GTX 770 clouds pass at given quality takes 1.1ms and upscale blur processing on it around 0.3ms (if I remember correctly, I am sure about 1.1ms for clouds themself). Additionally, this is without temporal sampling and price can be reduced to 1/4 or even 1/16 (minus overhead it causes) by using technique described in the paper I linked.

Demo Scene is quite limited because it is just something I made to test engine while writing it and there wasn’t reason to allocate more time to it as my job was to create rendering pipeline, not the assets. All these assets were made during one evening (or time equivalent to that).