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, the relevant bit (i think):
picture (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.
First I see that you haven’t enabled the depth test. So in your display function call glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);.In your init function call glEnable(GL_DEPTH_TEST). In your main function call glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); Now your display should work.
looks like depth buffer to me to. its important to not only use depth test but also to supply the correct projection matrix with correct near/far values. other then that, do you use backface culling? try setting culling to FRONT and render the sphere once, then set culling to BACK and render sphere again.