problem with glblend
I am trying to create groundfog using some panels alphablended with glblend.
But I am also moving through the scene and there occurs a problem:
The blended fog part in the picture moves along (back and front) according to the camera. that way the fog always changes position.
anyone knows why?
this is how it is and where the foggy part should always stay
but if you move the foggy part moves too
but if you move the foggy part moves too
Fog depends on eye distance or screen Z, therefore it is going to move with the camera.
If you want fog to stay in a fixed location you can specify your own fog coordinates: see EXT_fog_coord, which is part of the core since OpenGL 1.4.
If you want fog to stay in a fixed location you can specify your own fog coordinates: see EXT_fog_coord, which is part of the core since OpenGL 1.4.
Quote:Original post by gold
Fog depends on eye distance or screen Z, therefore it is going to move with the camera.
I think hes useing quads to draw his fog.
and if thats the case thats not going to be true in this case.
That looks quite odd, its not staying in the same spot, but yet its still moveing.
I agree with Axesor, some code would help.
i tried the sample on several pcs - with different results, but not concerning this weird problem.
i found out that everything drawn after
//glDepthMask(GL_FALSE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
is moved around.
i found these lines in several blending examples and except for the moving thing they seem to work.
i found out that everything drawn after
//glDepthMask(GL_FALSE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
is moved around.
i found these lines in several blending examples and except for the moving thing they seem to work.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement