PDA

View Full Version : Having trouble with GL_FOG



MrUNOwen
02-27-2011, 11:07 PM
Does anyone know what would cause GL_FOG to only show up on drawn surfaces, as if the fog were only a texture? The fog doesn't move and only whites out surfaces in certain areas. Any non-drawn space is still clear.

Does blending, lighting or any other mode effect fog to behave oddly?

Alfonse Reinheart
02-27-2011, 11:30 PM
Does anyone know what would cause GL_FOG to only show up on drawn surfaces, as if the fog were only a texture? The fog doesn't move and only whites out surfaces in certain areas. Any non-drawn space is still clear.

That's how fog works. It only affects what you render. You must manually ensure that your clear color matches the fog color if you want to maintain the illusion that there is actual fog.

MrUNOwen
02-27-2011, 11:54 PM
How do I have the fog follow the camera, because it stays in one place?

ZbuffeR
02-28-2011, 05:45 AM
Read http://www.opengl.org/resources/faq/technical/projection_abuse.php
Sound like you move camera on projection matrix, rather than modelview.