SebastianPh
11-11-2008, 02:13 PM
Hellos,
I have a light and a transparent sphere. I set the diffuse material to make it transparent, but it doesn't work at all viewing angles. At some (camera) angles, there are some weird darker patches.
Complete sourcecode here (http://pastebin.com/m761a661b), the relevant bit (i think):
GLfloat diffuse[] = { 1.0, 0.0, 0.0, 0.5 };
glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
picture (http://bayimg.com/gaLAMAaBO) (but it does get arbitrary weird at other angles).
My only guess would be that this is the wrong way to make an object transparent, but it seemed logical to me.
I have a light and a transparent sphere. I set the diffuse material to make it transparent, but it doesn't work at all viewing angles. At some (camera) angles, there are some weird darker patches.
Complete sourcecode here (http://pastebin.com/m761a661b), the relevant bit (i think):
GLfloat diffuse[] = { 1.0, 0.0, 0.0, 0.5 };
glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
picture (http://bayimg.com/gaLAMAaBO) (but it does get arbitrary weird at other angles).
My only guess would be that this is the wrong way to make an object transparent, but it seemed logical to me.