Is Mist Height Gonzo?

Hi there,
I recall there being a height parameter for Mist in the BGE. It doesn’t seem to be there any more. Am I just looking in the right place?
It’s been on my radar for a while to see how it worked? Would it be good for mist down a chasm? Alas… doesn’t seem to be there anymore.

If anyone has any suggestions, I would be eternally grateful.
:slight_smile:
M

The mist height option never worked in the BGE (even back in Blender 2.25).

It was removed from the BGE UI options as a result.

Ahhh… I see… thanks.
M

You could implement it yourself with just alpha-enabled planes stacked one on top of another, or probably with a GLSL shader.

How would we do it with a shader? I’m interested in floor fog because my game is pretty much an isometric rpg, so z depth mist would be useless to me.

alpha-enabled, no-collision planes would work pretty well :stuck_out_tongue:

I’m gonna guess you would make a box that represents your “boundary” of fog, and then have the alpha component of the fragment shader of the box be related to the Z value of the vertices. I’m not sure on the specifics, but it should be possible… I think.

EDIT: Thislink might be of some assistance.

You could also mess around with node shaders - people have gotten pretty powerful results out of them as well.

But I would probably go with the plane approach initially, since it’s easy to manage and set up. You could always edit it later if it proves to be an issue (e.g. for alpha-enabled objects).

I’ve gotten good results with node shaders, but there are definitely some limitations- blend in a color based on the Z-height of the material (or maybe use a lamp node to make it adjustable in-game). The hitch is those nodes would have to be on every material that can go into the mist, and its height would be global for the whole game world so planes might be better if you want the mist to be higher in places and lower in others.

The other catch with node shaders is if the camera goes into the mist the illusion breaks. With planes, there will be mist in front of the camera, whereas with nodes if the camera is in the mist looking out there won’t be any appearance of fog. However, given specific uses, node mist can look really good.