Fog question

Started by
2 comments, last by zedzeek 19 years, 5 months ago
Hi all! I've already posted a similar question before, and it was partially solved. But I'm still curious whether a new idea could be implemented. I just don't know how to make the fog _involves_ all the objects in the scene like a real fog. I have the impression of seeing the fog stucked inside the platform, the model and the containers (it can be seen in the screenshot bellow). Could someone help me? Project + EXE Thanks in advance! [Edited by - MajinMusashi on November 29, 2004 1:45:09 PM]
Advertisement
If you want fog to involve all objects, then for each object, you have to calculate and apply a fog value, using the visual distance to camera and your fog function. Note that this will likely lead to your skybox being fog-colored all the time, because it's always visually behind everything else.

A work-around for the sky box problem is to make the sky box be mostly fog-colored at ground level, but fade to the actual pretty sky as you go up. This can be done with a shader (to be able to vary fog color), or just painted in (if you have a fixed fog color).

Other work-arounds include limiting the amount that fog can contribute (say to 50%).
enum Bool { True, False, FileNotFound };
Quote:Original post by hplus0603
If you want fog to involve all objects, then for each object, you have to calculate and apply a fog value, using the visual distance to camera and your fog function.

Ok, I can almost see it, but if I'm right, the result won't be so realistic, right?

Quote:Note that this will likely lead to your skybox being fog-colored all the time, because it's always visually behind everything else.

If you take a look at the source you'll find that I'm not using a skybox. It is just a simple flat fixed background (textured quad) rendered in ortho view. Is this a problem?

Quote:A work-around for the sky box problem is to make the sky box be mostly fog-colored at ground level, but fade to the actual pretty sky as you go up. This can be done with a shader (to be able to vary fog color), or just painted in (if you have a fixed fog color). Other work-arounds include limiting the amount that fog can contribute (say to 50%).

Wooow^2. I've initially thought in something like Quake3 fog in some maps, where it is only near the ground, like real fog or smoke...

Thank you, hplus0603!
>>If you take a look at the source you'll find that I'm not using a skybox. It is just a simple flat fixed background (textured quad) rendered in ortho view. Is this a problem?<<

how much a vertex gets fogged depends on the distance from the viewer to that vertex, now with this background quad i assume allvertices are gonna be a equal distance away from the viewer thus will all have the same fog amount. perhaps u can draw the fog already on the background texture

This topic is closed to new replies.

Advertisement