Choosing Opengl with Alpha Test

From what I saw on the Internet, this problem cannot be solved with my approach.

I am currently writing a program that uses a selection buffer, passing all the objects in the scene. However, one of the objects is a texture, in which a significant part has alpha 0. It works fine when rendering, alpha values ​​are not displayed, but when the alpha test is skipped in the selection mode and hover over transparent areas, select the object instead of what is behind him.

Is there a way to enable alpha testing in select mode?

0
source share
2 answers

, , - . , , - GL_SELECT. , glEnable (GL_ALPHA_TEST), glAlphaFunc(), , . , , . , OpenGL ; , GL_SELECT.

, . , , , .:)

, , OpenGL Alpha manpage glAlphaFunc.

+1

, glReadPixels - ,

http://www.opengl.org/sdk/docs/man/xhtml/glReadPixels.xml

- :

glReadPixels (0, 0, XSCREEN, YSCREEN, GL_ALPHA, GL_UNSIGNED_BYTE, buffer);
0

Source: https://habr.com/ru/post/1775071/


All Articles