Android +ndk+eclipse+opengl ES2.0 Open Depth test

Source: Internet
Author: User

Reference: Https://www.opengl.org/discussion_boards/showthread.php/172736-OpenGL-ES-Depth-Buffer-Problem

Environment: Eclipse,ndkr8,opengl es2.0,android

The recent development of Android OpenGL es2.0 using Eclipse and NDK has found that the object being drawn is not related to depth, but to the order in which it was drawn. Think about it, it should be that the depth test is not turned on, glenable (gl_depth_test) is turned on, but the depth test is not working. Online, because the window created by Eclipse did not open the depth test.

Seteglconfigchooser (translucent?                             New Configchooser (8, 8, 8, 8, Depth, stencil):                             new Configchooser (5, 6, 5, 0, Depth, stencil)),//depth and setencil need to be set to 1



After setting, the order of the objects drawn is really related to the depth.

Summarize the open depth test:

(1) The window to be drawn first is set to support depth testing

(2) in OpenGL es2.0 code, you have to open the depth test (glenable (gl_depth_test))




Android +ndk+eclipse+opengl ES2.0 Open Depth test

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.