Distance to Geometry --> Alpha ?

After trying different and interesting but slightly flawed Methods, I have tried to achieve some classical Silent Hill Fog by making little Cloud Objects fly around. However, the Main Problem about this Method is wherever the Object intersects with Geometry – it just doesn’t look smooth. No Surprise, of Course and Curse, but is there any Way that the Transparency of the Cloud Material could decrease the closer it gets to any Geometry?

Have you done that? Looks pretty neat , ignoring the issues though.

I have an idea which I’d like to write here so I don’t forget it;

Have two scenes - one the geometry scene, the other the fog. Take a mask of the geometry scene (perhaps using depth) and apply it to the image from the fog scene. Mix the images and then render to camera

This is going to sound a bit low tech, but could you give the fog planes a collision boundary? As they drift, they would then naturally avoid obstacles (and not clip). If they are small enough they might even flow around other objects.

But a cool effect though.

@ BlendingBGE: Yep, it’s mine and thanks as well, even though.

@ Rubbernuke: I am afraid that is no Option. I already tried giving all those Cloud Objects Collision and also make them do something when they collide… the Result was a total Performance Breakdown – not much to my Surprise but still surprisingly extreme!

@ agoose:
The Guy on this Site http://prideout.net/blog/?cat=3 actually describes Soft Particles (… scroll-down a Bit…) working just like I described in the first Post and is giving some Code – might it be that the Method actually is just the same as you described in your Response?
Since I am not a great glsl-Coder with BGE I rather ask first if the Method he uses would be translatable to the BGE in the first Place.
(I know that martinsh has once done Soft Particles but the Example looked as if the Particles would only fade into the Ground – if that is so, I have also just tried that with my Clouds and it works more than fine, but only on a mere XY-Plane at Z=0 by Default – that’s not a Lot, but still looks a Tad better than before.)