PDA

View Full Version : GL_BLEND quick question



wazoo
11-02-2000, 08:45 PM
Hi just a quick problem I'm having with GL_BLEND and wondering if anybody could help.. http://www.opengl.org/discussion_boards/ubb/wink.gif

I've got a background drawn as textured quads, then in the foreground I want to draw some tranparent cubes...

I disable the depth testing and enable glblending, but I can't get anything to draw in the foreground...

I've also added some textured quads to handle text output and THEY display fine, but not my transparent cubes...

any suggestions??

ie..

glDisable(GL_DEPTH_TEST)
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

glMatrixMode(GL_MODELVIEW)
glPushMatrix
//draw my cube here
glPopMatrix
glDisable(GL_BLEND)
glEnable(GL_DEPTH_TEST)

thanks for any help..

wazoo

jc
11-02-2000, 09:54 PM
Did you try with enabling the depht-test ?

11-02-2000, 11:08 PM
instead of glEnable/Disable(GL_DEPTH_TEST)

when doing alpha blended polys use glDepthMask(GL_FALSE);

then with regular polys glDepthMask(GL_TRUE);

wazoo
11-03-2000, 05:06 AM
Yup I tried both the above suggestions already and I still can't get them to draw..

I've even taken out all my lighting code
and played with the view frustrum !!

sigh http://www.opengl.org/discussion_boards/ubb/frown.gif

does anybody have any other suggestions??

thanks though to everyone who's helped!

Wazoo