PDA

View Full Version : transparent sphere with GLUSPHERE



ilnumerics
12-22-2008, 03:59 AM
I need a simple sphere to be drawn with transparency and lighting enabled. Is it true, I cannot use GLSPHERE for that? I need to order all quads (?) from back to front for drawing, right? GLSPHERE draws them the same way every time, regardless of the camera position? Or is there any workaround for that?

thanks, haymo

martinsm
12-22-2008, 05:31 AM
You can do it by enabling culling, and using two draw calls - one with glFrontFace(GL_CW) and another with glFrontFace(GL_CCW). First draw call will draw back faces of sphere, and second one front faces, therefore you will get transparent sphere with correct polygons rendered from back to front.