nk
05-22-2004, 12:16 AM
I have a scene where I draw some polygons against a black background with transparency and I use for this
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)
Everything works fine, my polygons are transparent, but now I want to add and ligting to my scene:
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT);
GLfloat lmodel_ambient[] = { 1, 1, 1 , 1 };
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,lmodel_ambie nt);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
glEnable(GL_LIGHTING);
At this point I loose all the transparency on objects. Why?
There is any possibility to have transparent object & light?
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)
Everything works fine, my polygons are transparent, but now I want to add and ligting to my scene:
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT);
GLfloat lmodel_ambient[] = { 1, 1, 1 , 1 };
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,lmodel_ambie nt);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
glEnable(GL_LIGHTING);
At this point I loose all the transparency on objects. Why?
There is any possibility to have transparent object & light?