Jump to content
  • Advertisement
Sign in to follow this  
coderWalker

OpenGL OpenGL Fog

This topic is 2837 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!