|(OpenGL on vs2008)
I'm drawing surfaces, not volumes. the issue is corruption (or maybe PEBKAC) when displaying "blended" (transparent)
I don't seem to understand how the surface must be "setup" to obtain full surface transparency on both the front side and back side.
I have something like :
::glReadBuffer( GL_BACK );
::glDrawBuffer( GL_BACK );
::glDepthFunc( GL_LESS );
::glEnable( GL_DEPTH_TEST );
glPolygonMode ( GL_FRONT, GL_FILL );
glPolygonMode ( GL_BACK, GL_FILL );
glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE );
glDepthMask( GL_FALSE );
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glColor4ub( red, green, blue, alpha );
glDisable( GL_BLEND );
glDepthMask( GL_TRUE );
glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE );
When using this code, there are some corruption in the display, surface "patches" are not rendered appropriately when displaying against "itself", for example a front facing polygon of a cone or cylinder which is displayed against a back" face of the same cone or cylinder.
see images showing the issue:
simple cylinder :
a cone, a sphere and a plane.
Watched code never compiles.