Game Development Community

Limiting range of view using fog or something?

by Infinitum3D · in Torque Game Engine · 01/10/2007 (4:42 am) · 2 replies

One thing that kills my framerate, and is also very unrealistic, is that visibility is virtually endless. In commercial games (like Morrowind III for example), there is a fog that limits how far you can see. Anything beyond a certain distance is simply a gray haze. I think that means that only close things are rendered, which helps with framerate.

Is there an easy way to limit the distance of visibility?

thanks!

Tony

#1
01/10/2007 (5:26 am)
In the world editor (F11) under the sky heading there should be two relevant data fields for fog drawing both near (distance from camera before fogging starts) and far (distance from camera when fogging is total obscuring). The fields should be near the top of the sky datablock properties list.

Here's an example . . .
VisibleDistance: 400 (far distance, after this point, objects are no longer visible)
FogDistance: 200 (near distance, where fogging begins)

So from this example, objects at distances from 0 to 199 from the camera should be clear as day. At 200, a small amount of fogging should begin. Objects at 300 should be 50% fogged. And at 400, objects should be completely obscured.

I hope that helps.
#2
01/12/2007 (2:41 pm)
Excellent!

Thanks!!!