LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: kramer on August 05, 2005, 08:47:36

Title: SkyDome + Fog
Post by: kramer on August 05, 2005, 08:47:36
Hi All,

I want to have nice picturesque clouds in my sky, so I am using a texture mapped sky dome which achieves this nicely.

However, I also want to have the terrain get hazy in the distance, which I can achieve with glFog. The problem is that the fog completly kills the sky dome because of it's distance away.

It occurred to me that one could write a pixel shader which imitated the fog equation but only near the horizon (decreasing as Y increases, thus allowing the beautful clouds on the sky dome texture to show through.)  But before attempting such a shader I wanted to see if anyone else had overcome this problem in a different way.
Title: SkyDome + Fog
Post by: darkprophet on August 05, 2005, 10:10:12
volumetric fog does that nicely. Not sure how easy that is to implement, but it shouldn't be too hard...
Title: hmmmmmmm
Post by: Fool Running on August 05, 2005, 13:44:52
You should be able to disable fog (and maybe extend your far Z plane) then draw the dome, then setup the fog (and maybe the far Z plane) to draw the terrain.
Title: SkyDome + Fog
Post by: kramer on August 08, 2005, 14:03:05
Ahh, thanks.  that worked nicely