
Question about blending...
Hey guys,
I''m trying to get a scene working where I have a background rendered with textured quads, then in the foreground I have
transparent cubes....
I can''t get the cubes to display no matter what I try! argh!
My procedure for drawing the cubes:
glDepthMask(GL_FALSE);
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_SRC_ALPHA);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -20.0f);
glScalef(1.5f, 1.0f, 0.9f);
glBegin(GL_QUADS);
//cube vertices here
glEnd();
glPopMatrix();
glDisable(GL_BLEND);
glDepthMask(GL_TRUE);
can ANYBODY see anything wrong with this?? Do I need to disable lighting as well?? I can''t seem to see what''s wrong with this code (I''ve checked nehe''s tutorials, and what I''m doing appears right!)...
thanks in advance!!
Wazoo

Learn about game programming!Games Programming in C++: Start to Finish
perhaps glDepthMask dont work korrekt on your gf (NeHe told this)
try it with glDisable(GL_DEPTH_TEST); and glEnable(GL_DEPTH_TEST);
we wanna play, not watch the pictures


try it with glDisable(GL_DEPTH_TEST); and glEnable(GL_DEPTH_TEST);


If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud
November 03, 2000 03:51 PM
It would be a good idea to specify the alpha of the polygons, unless u use the RGBA format for the textures. If u use the RGB format then u should set the alpha value of the texture by using the glColor4f(r, g, b, a) command with a varying from 0.0 to 1.0.
also u should use glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) for a better approach. Dont'' forget to disable lighting.
also u should use glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) for a better approach. Dont'' forget to disable lighting.
November 03, 2000 03:52 PM
It would be a good idea to specify the alpha of the polygons, unless u use the RGBA format for the textures. If u use the RGB format then u should set the alpha value of the texture by using the glColor4f(r, g, b, a) command with a varying from 0.0 to 1.0.
also u should use glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) for a better approach. Dont'' forget to disable lighting.
u can contact me at boct@romwest.ro
also u should use glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) for a better approach. Dont'' forget to disable lighting.
u can contact me at boct@romwest.ro
Yup I forgot to mention that I specified a color of
glColor4f(1.0f, 0.5f, 0.5f, 0.9f);
I disabled lighting and disabled GL_DEPTH_TEST...no difference (at least none that I could detect)..
I tried the GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA for my blend function and nope..
I''ll play around some more but if anybody could help more..
THANKS!!
(and thanks to those who have helped so far already)
wazoo
glColor4f(1.0f, 0.5f, 0.5f, 0.9f);
I disabled lighting and disabled GL_DEPTH_TEST...no difference (at least none that I could detect)..
I tried the GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA for my blend function and nope..
I''ll play around some more but if anybody could help more..
THANKS!!

(and thanks to those who have helped so far already)
wazoo
Learn about game programming!Games Programming in C++: Start to Finish
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement