I am trying to draw a sphere with alpha, but I have a problem with my Z-buffer. Some pixels are transparent, but they are written in Zbuffer, so the hidden pixel is immediately hidden.
Here are my settings:
gl Enable: gl DEPTH_TEST.
gl DepthFunc: gl LEQUAL.
gl Disable: gl CULL_FACE.
gl Enable: gl BLEND.
gl BlendFunc: gl SRC_ALPHA with: gl ONE_MINUS_SRC_ALPHA.
I know that the function glAlphaFunc(GREATER, aFloat)and enable(ALPHA_TEST)can do it, but I have read that it is deprecated feature from version 3.1 OpenGL. How can I make the correct render without using ALPHAFunc? Does anyone know a trick or a way to do this through shaders?
source
share