Skip to main content
gamedev.net
🔒 Locked

Fog problem

Started by MajinMusashi 1 reply 600+ views
Original Post
MajinMusashi
MajinMusashi
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!
zedzeek
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 )
MajinMusashi
MajinMusashi
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!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.