This has always puzzled me, since it doesn’t look like the fog you’d see in games, even old games from the ps2 era:
Panda’s fog appears to be attached to the geometry, whereas fog from other games is suspended in the atmosphere and extends to cover the geometry as well. Are such effects achieved only via shaders? Or are there other tricks like adding dummy-nodepaths with transparent-geometry at different points in the scene to make it seem as though the fog is suspended in the atmosphere as well? Any pointers on how to achieve a fog-effect like in the second image will be greatly appreciated.
Here is an example of fog, there is no lighting here, so it looks flat. I think that you can somehow add noise to the buffer for fog, but the filter manager is not used here, I have no idea how to do it.
fog = Fog("fog")
fog.set_color(128/255.0, 128/255.0, 128/255.0)
Thank you both for the insight; yes, I did make set the background colour to match the fog’s colour, however, the results were at times not satisfactory when camera movement came into play. However, if these games did the same thing that panda3d does when it comes to basic fog as you suggest, then I will have to go with something similar, albeit with some hacks to accommodate sudden camera transitions.
Could you elaborate, please? Perhaps whatever issue you’re seeing might be at least alleviated somehow.
Oh, and let me note that old games may at times have added particle systems (or something similar) into their fog effects, using big, semi-transparent particles to provide a bit more depth and form to the result.
Yes, something like volumetric fog sounds interesting, but I’m not sure if in my case it would warrant all that effort, since I’m trying to keep things more or less simple. Further, I’m not predisposed to using the render pipeline, a marvelous tool no doubt, but with the drawback of crashing on certain cards (I think intel cards?), that and it being somewhat bulky.
I do get similar results to that, but at times the edges of my world pop-out, which is what prompted me to start this thread. I’m not sure what adding noise to the fog buffer would achieve, an example of that in action would be nice though.
Sure, but I doubt it’s that big an issue, I probably just have to modify the settings like the linear-range/fall-back for the linear fog or the density for the exponential fog up when the camera shifts to a point in the game that isn’t done generating yet, but if something else happens to be the matter then I’ll ask if necessary.
Ah, fair enough. I think that I can imagine the issue that you’re seeing, and how you deal with it likely depends on the specifics of your game and how the issue presents for you. There are, I daresay, a few ways of addressing it!
I think I remembered that I did something similar.
However, I didn’t adjust the lighting. By the way, the fog can be made more interesting if you make a ball with a transparent texture around the player, in the video blue is an imitation of a force field, but you can make a good background that will merge with the fog.
Alternatively, you can use AmbientOcclusion. This will add silhouettes to your objects. I think it would also be correct to use the linear fog mode, it had more options for control.