• Advertisement
Sign in to follow this  

glFog causing solid colour rendering

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

[b]Problem Solved:[/b]
Density was too high. Dropped it to 0.002 and it was fine.

[b]Problem:[/b]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:
[img]http://i51.tinypic.com/14kbbpj.png[/img]

With Fog:
[img]http://i56.tinypic.com/2vabn5y.png[/img]

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
[quote name='mhagain' timestamp='1305989219' post='4813860']
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.
[/quote]

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