Jump to content
  • Advertisement
Sign in to follow this  
MajinMusashi

Fog problem

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

Hi all! I just can't get a right looking fog, and hope you can help me. Bellow is the params I'm actually using: GLfloat fogColor[4]= {0.7f, 0.7f, 0.7f, 1.0f}; glFogi( GL_FOG_MODE, GL_LINEAR ); glFogfv( GL_FOG_COLOR, fogColor ); glFogf( GL_FOG_DENSITY, 0.35f ); glHint( GL_FOG_HINT, GL_DONT_CARE ); glFogf( GL_FOG_START, 1.0f ); glFogf( GL_FOG_END, 5.0f ); glEnable( GL_FOG ); and these are the resulting screenshots (without and with fog enabled): Source + EXE (1.3 Mb) Thanks a lot!

Share this post


Link to post
Share on other sites
Advertisement
glFogf( GL_FOG_DENSITY, 0.35f ); is used with GL_EXP(2) fog not linear so u can remove that.
i dont know exactly what want perhaps
measure the distance from the center of the quad to the camera.
use that as START and measure the disance to the furtherest point use that as END

measure with some function that goes like
float dist = length_of_vector( camera_pos - ws_pos )

Share this post


Link to post
Share on other sites
Quote:
Original post by zedzeek
glFogf( GL_FOG_DENSITY, 0.35f ); is used with GL_EXP(2) fog not linear so u can remove that.
i dont know exactly what want perhaps
measure the distance from the center of the quad to the camera.
use that as START and measure the disance to the furtherest point use that as END

measure with some function that goes like
float dist = length_of_vector( camera_pos - ws_pos )


Thanks for the hint about GL_FOG_DENSITY.
Well, an ordinary fog (involving all the objects in a similar way) would do the job for me. If I could limit the fog to the area bellow the platform it would be much better, but I think this is only possible with volumetric fog (am I right?).

Can you help me? Goodbye!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!