Menu
Forums
Login | Register

Home > Forums > OpenGL ES > blending problem Page :  1 
blending problem
Hi,
I have a problem with alpha blending
I enable the blend function with glEnable(GL_BLEND)
but when i enable the glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA) the command haven't effect but if i do glBlendFunc(GL_SRC_ALPHA,GL_ONE) the alpha blending is correct ... WHY???
Thanks a lot
Matteo
Hi,

It depends what your scene looks like.

It is possible that your source alpha value is 0.0 which results in the 2nd parameter being equivalent to GL_ZERO.

Regards,
Grant
but the alpha values isn't 0 never...
Hi,

Are you disabling depth testing :

glDisable(GL_DEPTH_TEST);

as this can cause problems. Please paste a small segment of your code here so we can see how your calls are structured.

Regards,
Grant
I disable depth test yet but the effect si like previous.
passes = 1;
draw opaque object
passes = 2;
glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
draw transparency object
glEnable(GL_DEPTH_TEST);
glDisable(GL_BLEND);

in the draw method :
if(passes==1){
if(isTransparency==false){
DRAW
}
}
if(passes==2){
if(isTransparency==true){
glBlendFunc(GL_SRC_ALPHA , GL_ONE);
DRAW_OTHERS
Hi,

Are you setting the colors of your objects with some alpha value which is not 0.0 or 1.0 (ie. using glColor4f, etc.).

Also, make sure that your glClearColor function has 1.0 as the alpha value as sometimes this can also cause issues.

Regards,
Grant

Home > Forums > OpenGL ES > blending problem Page :  1 

You need to be logged in to reply to this topic.


All Rights Reserved, © Zeus Communications, Multimedia & Development 2004-2005

Read the Disclaimer

Links