Jump to content
  • Advertisement

Archived

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

Nathan Hoobler

OpenGL OpenGL -- No fog?

This topic is 6579 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my attempts to learn OpenGL, I have been working out of both a reference book I have and the online NeHe tutorials (a terrific resourse, Kudos there). I have run into a rather perculiar quandry: The fog effects do not work! Here is a point-by-point breakdown... - My fog effects (enabled by the following code) are not apparant at all. //... Code ... GLfloat fogColor[4]= {1.0f, 1.0f, 1.0f, 0.0f}; glFogi(GL_FOG_MODE, GL_EXP); glFogfv(GL_FOG_COLOR, fogColor); glFogf(GL_FOG_DENSITY, 0.1f); glHint(GL_FOG_HINT, GL_NICEST); glFogf(GL_FOG_START, 1.0f); glFogf(GL_FOG_END, 10.0f); glEnable(GL_FOG); // ... More Code ... - The fog in the NeHe tutorial ALSO does not work! There is no fog in either the precompiled executable or in the recompiled source. - Finally, the fog demo in the book I am using (OpenGL SuperBible, Edition 2)DOES work! It is GLUT-Based, and for some odd reason has it''s fog enabling code running every time it redraws. I have tried mimicing this, but my code still does not work. Any suggestions from GL Gurus would be of great help. -- Nathan Hoobler

Share this post


Link to post
Share on other sites
Advertisement
i am not a guru in OpenGL but I sure do have that SuperBible book. Which page is it? that''s rather wierd...

sig u say?

Share this post


Link to post
Share on other sites
It looks like a driver compatibility problem.
Maybe the type of fog you tried to use simply don''t work with the card you own, and Superbible sample use the software rasterizer instead of your 3d card...

What card have you got ?


-* So many things to do, so little time to spend. *-

Share this post


Link to post
Share on other sites
3dfx OpenGL driver doesn''t support fogging. For those interested in a solution, i answered the question on Nehe''s forum.

Y.

Share this post


Link to post
Share on other sites
Hmm....perhaps you should change GL_FOG_END to 100-200 ´cause a fog range from 1 to 10 might be not visible at all.

HTH,XBTC!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!