UPBGE 0.3 - glsl mist

Hi,
here is a customizable glsl mist for UPBGE 0.3. (did you miss the mist?)
UPBGE_0.3_glsl_mist.blend (1.3 MB)

By setting the game properties you can choose between 4 different mist-models, set the density, start distance and if it should start in radial form from the camera.
The color can be set by its object material.

It was heavily inspired by this script:
https://blenderartists.org/t/glsl-controllable-mist/630061/16

3 Likes

And here is an Underwater Version inspired by What are some good underwater/distort 2d Filters? - #11 by carlo697

UPBGE_0.3_glsl_Underwater_mist.blend (1.2 MB)

edit: now you can choose between 3 wavemodels (see properties).
1 (large)
2 (small) or
3=both

3 Likes

ok,
updated both files above.(Mist mode 4 wasn’t correct Exponential Squared Fog)
You just need the 1st logic brick line for the Mist to work.
But I added some controls for playing with the properties:
Keys 1-4: Mist mode
Mousewheel: Mist Density
Mousewheel + Ctrl: Startdistance of the Mist from the Camera

Additionally in Underwater Version:
Keys 5-7: wavemodels 1-3

This is really cool, thanks.
Is there any way to control height? Like how high the mist goes?
M

Not with this 2d-Filter.
Perhaps some glsl-experts can say if this would be possible at all in UPBGE 3.0.

1 Like

Thanks for the response.
Yeah… would be cool if there was a way to add to this mist thing in 3.0

I implemented a height fog filter a while back for BGE, I should just clean up the blend and make it compatible with UPBGE, I guess.

Yes please, this would be very interesting!

Sharing the link to the height fog thread, for future visitors.

1 Like

Hey, Im trying to get this to work after transplanting it to another scene but the filter just doesnt seem to work, are there any special items in your scene that this filter relies on?
I copied the mist cube and I think its all running, just no fog…

You also have to append the text “init_mist.py”