OpenGL Fog

Started by
1 comment, last by coderWalker 13 years, 1 month ago
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?
If this post was helpful please +1 or like it !

Webstrand
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.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
[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]
If this post was helpful please +1 or like it !

Webstrand

This topic is closed to new replies.

Advertisement