Archived

This topic is now archived and is closed to further replies.

Keermalec

Applying fog to geometry only, not background

Recommended Posts

Hi, I would like to apply a white fog to my polygons, but not to the background (I have a nice skybox I do not want to lose). The idea is to have polygon colour fade with distance without turning the background all white. Any ideas would be much appreciated. PS: If possible, without using extensions...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Just disable fog when you draw the sybox, and enable it when you draw the geometry.

Share this post


Link to post
Share on other sites
What About...

glDisable (GL_FOG);
DrawBackground (); /* Draw the nice skybox */
glEnable (GL_FOG);
DrawGeometry (); /* Draw all the geometry */



theNestruo

Syntax error in 2410
Ok

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Oh, wait you want it to blend with your background. Sorry I misunderstood. Someone, it was in the OpenGL forums a few days ago just can''t remember who, did this by making objects more transparent as they moved farther away from the camera. It looked very nice and is probably what you are trying to accomplish. I''ll try to find the thread.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Ok found it! It was _DarkWing_ who made the post here:
http://www.gamedev.net/community/forums/topic.asp?topic_id=199209

You can probably email him for details on the technique he used, but it looks great and is probably what you are after.

Share this post


Link to post
Share on other sites
Man is that fast help or what - my fog works beautifully on geometry and not on background. Thanks a lot.

Anon, I can't use darkwing's technique (even though it looks awesome) beacuse my background is not a single colour, it is a skybox with a gradient from white to blue, therefore progressive transparency with distance would really make the model seem transparent!


[edited by - Keermalec on January 6, 2004 6:18:09 PM]

Share this post


Link to post
Share on other sites