problem with glblend

Started by
5 comments, last by snapdrag 18 years, 1 month ago
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?
Advertisement
im having a hardtime picturing what u mean, perhaps post some small screenshots?
this is how it is and where the foggy part should always stay
Image Hosted by ImageShack.us

but if you move the foggy part moves too
Image Hosted by ImageShack.us
Can we see a code snippet?
.::WARNING!::. Axesor is a total newb or n00b! Beware his lack ofintellegence of OpenGL. Feel sorry for him and keep him in your thoughts.~Leader of the phsychoward
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.
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 seek knowledge and to help others whom seek it
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.

This topic is closed to new replies.

Advertisement