Game Development Community

Volumetric Fog

by Blake LaPierre · in Torque Game Engine · 03/03/2003 (6:23 pm) · 12 replies

Has anyone added this to the engine yet? It would be nice to be able to do some fog other than just the distance fog that goes over the whole map. If no one has I think I'll attempt to add in some type of basic volumetric fog after I learn some more about it.

#1
03/03/2003 (7:15 pm)
Thatd be cool
#2
03/03/2003 (7:37 pm)
Torque already has support for 3 fog 'layers' which are good for filling a valley with fog, say.

There isn't any support for arbitrary shaped fog volumes, though.

There's some info on fog layers in this thread:
www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=3232
#3
03/03/2003 (8:18 pm)
Yeah, but the problem with fog layers is that it covers the whole map at that depth with the fog. If you put an interior below the fog level it will still have the fog. If you want fog in one valley, but not in the other you can't go down to the fog level in the second valley. Also you can never really be in the fog, well you can set the distance to 0 or even negative, but it just doesn't look right.
#4
03/03/2003 (8:41 pm)
Could you animate the volumetric fogs shape?
#5
03/03/2003 (8:55 pm)
I'm sure it's possible.
#6
03/03/2003 (9:07 pm)
yay itd be cool if you could AHEM open up the art pipeline for torque games.
#7
03/03/2003 (11:09 pm)
Would it be possible to do it like putting down a water block?

This is a cool idea, and I would love to see it happen
#8
03/04/2003 (6:15 am)
@Blake: "Also you can never really be in the fog, well you can set the distance to 0 or even negative, but it just doesn't look right." I'm not sure I follow; the fog layers always seemed to work fairly well in regards to being in the fog bank.

You can generalize volumetric fogging by casting a ray to every vertex on screen and seeing how "much" fog your ray goes through (ie, how much distance through fog volumes the ray travels). You can do the same at the pixel level, if you like, but at a pretty nasty performance hit.

Torque does an optimized variant of this - ie, it just checks by height, saving an order of magnitude of calculations.

I'm not aware of any other reliable volfog methods.
#9
03/04/2003 (6:48 am)
I guess it would be similar to the water effects. I wonder if the water system could just get hacked to do crazy fog effects. You probably couldnt animate the water brushes though. Someone ...AHEM!... needs to do that! I agree though the torque fog isnt ugly but isnt to realistic.
#10
03/04/2003 (6:54 am)
Water uses pretty much the same system as normal volumetric fog... Sorry :)

You could probably extend the fog system to use fog blocks, though, and have different layers for different areas, though it might look wrong if you could see "through" multiple blocks. Really, that would just be an ugly hack - better to fully extend the system with true volumed fog if you need that, or live with layered fog if you don't.

If you need to do "enhancements", like an evil, foggy valley, why not just adjust the fog levels based on the player's location? Tween from "normal fog" to "evil fog" as they approach the area. This is what the weather system does already, and it works pretty well...
#11
03/04/2003 (8:40 am)
Tim: What's with the "AHEM!"'s? You've got the source too - get busy on it if ya want it ;-) That's how I got particle LoD and Terrain Deformation :-)
#12
03/04/2003 (9:10 am)
I think blake would be much better off doing any engine coding. I cant make heads or tails of the engine source really. I understand certain aspects, I would if i could though. Im learning but im not holding my breath.