Jump to content
  • Advertisement
Sign in to follow this  
coderWalker

OpenGL OpenGL Fog

This topic is 2752 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

I want to have a Day/ Night cycle in my game. I can change the ambient color fine.
However when I change the fog color during run time it always results in white?

Is this not allowed?

I have this is the programs loop:

float FogCol[3]={127.0f*time,185.0f*time,229.0f*time};
glFogfv(GL_FOG_COLOR,FogCol);


time being a float with a value from 1.0f to 0.0f.
So it should slowely go from Blue sky to Black.
Whats wrong with this?

Share this post


Link to post
Share on other sites
Advertisement
You should familiarize yourself with reading the specs for these functions.

glFog for example: http://www.opengl.org/sdk/docs/man/xhtml/glFog.xml

Read the description given for GL_FOG_COLOR, and see if it makes sense to you. It should enlighten you to what you're doing wrong.

Share this post


Link to post
Share on other sites
[font="Arial"]I am a n00b.
Thanks man

I did have it set up so it was
[/font][font="Arial"]127.0f/256.0f somehow that was lost when I added *time.


Thanks for the link[/font]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!