I am working on a 3d structure using ofTrueTypeFont class for visualizing texts on it.
I am encountering some problem in drawing lettering with alpha channel and GL_DEPTH_TEST
enabled. Texts fields are always perpendicular to the view but types background don’t look transparent when it covers other elements (lines and sometimes other fields).
Any help will be appreciated.
Draw everything opaque then after disabling writing to the z-buffer using glDepthMask(FALSE); draw your transparent objects from front to back (called painters algorithm). You may need to sort them to get them to draw in the correct order.
Thanks a lot,
I have just found an alternative solution which works in my case,
on setup I am enabling alpha test
glAlphaFunc ( GL_GREATER, 0.5) ;
glEnable ( GL_ALPHA_TEST ) ;
It’s not perfect but it works.
Maybe this document http://www.opengl.org/wiki/Alpha-Blending could help for similar problems.