Unity URP 2022 Volumetric Fog Shader

The height fog can be modified with a 3D texture (which gets advected by curl noise)

The height fog can be modified with a 3D texture (which gets advected by curl noise)

Full support for light cookies.

Full support for light cookies.

After Unity 2022 was released with it's Forward+ renderer, I noticed how all the lighting information was easily accessible from global compute buffers, meaning any shader could access lighting information with a basic position check. This inspired me to put together this volumetric fog post-process shader, as an experiment and a learning experience.

The shader runs at quarter res, and then upscales to full res with some blurring based on depth (no temporal upsampling implemented yet). All the lights are fully functional, and support everything they do for normal rendering (shadows, cookie textures). Shader runs fine with tons of unshadowed light. Gets very heavy when lots of shadowed lights are on-screen.

All the code is available on Github: https://github.com/Andicraft/VolumetricFog-URP2022 - though it's very messy, as it was never intended as a polished and released product, and more as a base for other people to continue on or learn from.