PDA

View Full Version : problem in blending



infinitecmdz
03-13-2004, 03:55 AM
hi,

I tried to blend a model with an opaque one inside the transparent model. everything works but i get some wierd effect while rendering. Actually, i'm trying to render a transparent model which encapsulates and opaque model. the outer model is transparent when rendering, but i get a black (i think)inner model which is stationary. i don't know where that came from. i'm using GLUI and when trying to rotate the model in blending mode, this black model covers the inner model. Its like having two inner models. one is pitch black and the other is the lit one.

i hope you understand what i mean.

if anyone wants the code, please tell me.

heres the piece of code that i did for blending :


if(blend)
{
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glColor4f(1.0f,1.0f,1.0f,0.5f); glEnable(GL_BLEND);
glDepthMask(GL_FALSE);
}
else
{
glBlendFunc(GL_ONE, GL_ZERO);
glColor4f(1.0f,1.0f,1.0f,1.0f); glDisable(GL_BLEND);
glDepthMask(GL_TRUE);

}

is the above code correct.

thanx



[This message has been edited by infinitecmdz (edited 03-13-2004).]

mikael_aronsson
03-15-2004, 02:59 AM
A screenshot of the problem might help.

Mikael