Cloud Rendering Sample Updated

This release is the update to the previously published cloud rendering sample and features a number of important improvements:

  • Better lighting model
    • Light attenuation in the body of the cloud is now computed using the 3D lattice. Attenuation is computed by ray marching the cloud density field stored in another 3D lattice. Compared to the original method, this new approach gives more accurate results and is less computationally expensive
    • Real-time shading model has been reworked and now incorporates better approximation for single and multiple scattering as well as for ambient light
  • New particle generation algorithm
    • The algorithm now uses cloud density 3D lattice to emit particles in voxels with non-zero density
  • Performance improvements
    • Only one fetch from a 3D texture instead of four is now required to load the pre-computed scattering from the look-up table
    • Computing light attenuation does not require tiling and particle rasterization
    • Particle sorting is performed entirely on the GPU and does not require sorting empty cells and serializing them using the geometry shader

There will be a chapter in the upcoming GPU Pro 6 that will thoroughly describe the technique. The full sample source code is available on GitHub. It can also be downloaded using this direct link

Below are some images generated by the sample:

This short video clip also demonstrates the technique:

For more complete information about compiler optimizations, see our Optimization Notice.