Jump to content
  • Advertisement
Sign in to follow this  
ChrisArmitt

glFog causing solid colour rendering

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

Problem Solved:
Density was too high. Dropped it to 0.002 and it was fine.

Problem:When using glFog everything is rendered in solid colour and I don't know why

In my initialization function I have
glEnable(GL_FOG);

And I have this in my render function directly after glLoadIdentity()

GLfloat fogColor[]= {0.5f, 0.5f, 0.5f, 1.0f};
glFogfv(GL_FOG_COLOR, fogColor);
glFogi(GL_FOG_MODE, GL_EXP);
glFogf(GL_FOG_DENSITY, 0.3);

Without Fog:
14kbbpj.png

With Fog:
2vabn5y.png

Share this post


Link to post
Share on other sites
Advertisement
Your fog density looks too high. Try dropping it to something much lower; start at 0.01 and experiment with values until you find one that looks good.

Share this post


Link to post
Share on other sites

Your fog density looks too high. Try dropping it to something much lower; start at 0.01 and experiment with values until you find one that looks good.


I managed to fix it earlier, thanks anyway though.
I also updated the thread, well, tried to update it, seeing as the edit post is still open in a different tab, looks like i forgot to finalize it XD

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!