Sign in to follow this  
MajinMusashi

Fog problem

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
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

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