• Advertisement
Sign in to follow this  

Trying to add some fog, but no effect

This topic is 4648 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 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
Advertisement
Sign in to follow this  

  • Advertisement