[PyOpenGL-Users] blend and depth problem
Brought to you by:
mcfletch
From: altern <en...@al...> - 2004-11-21 19:25:27
|
hi i am doing a 2D engine with ortographic proyection. I need to implement alpha blend and also depth, so that the shapes can be drawn at different z depths but also that the ones on front get blended against the ones behind. I am getting problems to achive this as either they wont blend or they wont get drawn on the depth they should. After checking out for the whole day and read the redbook and some online examples ... as far as i understand i need to play around with these parameters glEnable(GL_BLEND) glDepthMask (GL_FALSE) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) #before i draw the alpha shapes, and this: glDepthMask (GL_TRUE) glDisable (GL_BLEND) #before the shapes with no alpha But still i doesnt work properly. Maybe i need to switch alpha on before drawing alpha shapes and as soon as they are drawn switch it off. i am not sure, i have done hundreds of tests today and i am really confused. can anyone point into some example or solution? thanks -- enrike |