Sign in to follow this  

Trying to add some fog, but no effect

Recommended Posts

I threw this together quickly to test out fog in my scene. I get no errors but I also get no effect. Its my understanding that when I CFOG Fog, it should automaticly set defaults and add the fog. Any ideas what I am doing wrong? PFNGLFOGCOORDFEXTPROC glFogCoordfEXT; class CFOG { public: float Density; float Range[2]; float Color[4]; int Type; bool bOn; CFOG(void) { glFogCoordfEXT= ( PFNGLFOGCOORDFEXTPROC )wglGetProcAddress( "glFogCoordfEXT" ); glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); Color[0] = 0.0f; Color[1] = 0.0f; Color[2] = 0.0f; Color[3] = 1.0f; Range[0] = 0.001f; Range[1] = 100.0f; Density = 1.0f; Type = GL_EXP2; glEnable(GL_FOG); glFogi(GL_FOG_MODE , Type); glFogfv(GL_FOG_COLOR, Color); glFogf(GL_FOG_DENSITY, Density); glFogf(GL_FOG_START , Range[0]); glFogf(GL_FOG_END , Range[1]); glHint(GL_FOG_HINT , GL_NICEST); MessageBox(NULL, "SetUp", "FOG", MB_OK); } ~CFOG(void){} };

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this