Android + NDK + eclipse + opengl ES2.0 enable deep test, ndkes2.0

Source: Internet
Author: User

Android + NDK + eclipse + opengl ES2.0 enable deep test, ndkes2.0

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

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

Recently, I used eclipse and NDK for android opengl es2.0 development. I found that the display of the drawn object is not related to the depth, but is related to the order of the draw. After thinking about it, it should be that the deep test is not enabled, and the GL_DEPTH_TEST is enabled, but it still does not work. I checked it online because the deep test is not enabled in the window created by eclipse.

SetEGLConfigChooser (translucent? New ConfigChooser (8, 8, 8, 8, depth, stencer): new ConfigChooser (5, 6, 5, 0, depth, stencer )); // depth can be set to 16 or 8, representing the number of cache bits



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

To sum up, enable the deep test:

(1) The Window used for drawing must be set to support deep testing.

(2) In opengl es2.0 code, you must enable the deep test (GL_DEPTH_TEST ))




Related Article

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.