Volumetric fog shader

Hi there,

I’ve built a volumetric fog shader that I would like to share with you all.
It renders 3d noise colored by up to 5 lights. It needs a render and depth TOP as
input. (see also example).
It uses a raymarch technique to determine the fog density.

Video demo: [url]https://vimeo.com/247047174[/url]

Hope you enjoy it.

Cheers,
Tim
VolumetricFog.tox (117 KB)

New td versions (>=2022): VolumetricFog-2022.tox (118.0 KB)

6 Likes

Well done!
thank you for sharing !

Very nice!!
Thnks for sharing!!

very cool , thx for sharing

thx for sharing! Cool stuff!

This is great Tim, Thank you!

Is there a way to make this simulate a moving light or cone light beam? Like at a concert/nightclub when the fog/haze machine is running.

Thank you!

I’m afraid not with this version. I might write a new one in the coming weeks.

Thank you. Looks amazing!

Darn, this one seems to be not working after TD2021.15800. Either the depth.top (appears pure white) or the GLSL itself seems to be the issue, I am not sure. No error in network, but output is just pixel noise.

Hi there,

Thanks for mentioning! Turned out the new versions (vulkan) didn’t like the way the light matrices were send to the shader. I’ve updated it a bit so that it uses a chop to read from instead. This seems to work in 2022.29850.

Cheers,
tim

VolumetricFog-2022.tox (118.0 KB)

3 Likes

Nice, thanks! Still no dice with my 2021 version, but it may also be a Mac thing too.

Thank you for fixing this. I spent way too long trying to figure out why my old project is flickering like mad!