Home > other >  Questions about the depth of the OpenGL ES transparent arts test for help
Questions about the depth of the OpenGL ES transparent arts test for help

Time:09-25

Recently beginners OpenGl ES, do a 3 d graphics, encountered a difficult problem, because the texture contains transparent area, so I use glBlendFunc (GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA); Blend mode to make transparent display area, because of the perspective to achieve mobile, found that will cover order mistakes, and cannot be solved by changing the drawing order (because perspective will turn), naturally think of open depth test glEnable (GL_DEPTH_TEST); Covering the order finally, well problem arises: when texture contains transparent area in front and was the first to draw, can lead to a transparent area at the back of the object is not drawn, looks just like a piece of blank,
Hope ace directions, I appreciate,

CodePudding user response:

Opaque paint first, open the depth test, the transparent after drawing, don't open the depth test
  • Related