Fog and volumetric lights

any advice to add fog and/or volumetric lights to a scene?
thank you :slight_smile:

1 Like

Hi there,

There is a way to render it using raymarching. It involves glsl where you use the depth buffer of your regular renderTOP to see how far to raymarch. I’ve made something similar in the past, maybe that can get you started: Volumetric fog by Go Robot - ChopChopChop

Cheers,
tim

1 Like

@timgerritsen thank you Time, in my case I need to apply it to a glsl that is moving particles instanced in a geo top, so im not doing raymarching, i wonder if it can be done without raymarching

the raymarching part is a post effect, so your scene is still regular geo’s which can be particles. It’s just the fog is composite over it after (adding extra colors)

Ah I realized I also uploaded it to the forum which might be easier to download (I think you need to create an account at chopchopchop): Volumetric fog shader
The example with those cubes is based on regular geometry. Then using a depthTOP to retrieve the depths and composite the fog over it.

@timgerritsen thank you so much Tim, will check it out :slight_smile:

1 Like