Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6010421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:06:49+00:00 2026-05-23T02:06:49+00:00

I use the following code to retrieve the depth buffer: FloatBuffer pixels = ByteBuffer

  • 0

I use the following code to retrieve the depth buffer:

FloatBuffer pixels = ByteBuffer
    .allocateDirect(4).order(ByteOrder.nativeOrder()).asFloatBuffer();

GLES20.glReadPixels(pointx, pointy, 1, 1, 
    GLES20.GL_DEPTH_COMPONENT16, GLES20.GL_FLOAT, pixels);

Problem is, whichever point I am requesting, the pixels is giving me 0.0;

I have enabled the following in onSurfaceCreated:

GLES20.glEnable(GLES20.GL_DEPTH_TEST);
GLES20.glEnable(GLES20.GL_BLEND);
GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
GLES20.glDepthFunc(GLES20.GL_LEQUAL);
GLES20.glDepthMask(true);
GLES20.glClearColor(1, 1, 1, 1);

I’ve been struggling with this issue for days! Please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:06:50+00:00Added an answer on May 23, 2026 at 2:06 am

    According to the OpenGL ES 2.0 docs, glReadPixels() doesn’t support reading the depth buffer. What does glGetError() return?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I use the following code to retrieve the IP address of the local
I use the following code to retrieve image from the phone or SDCard and
I currently use the following code to retrieve and decompress string data from Amazon
I use the following code to set the retrieve the phone number in my
I am trying to use following code to retrieve character index by position in
I am use following code to retrieve the session variable in routes.php if($this->db_session->userdata('request_url')!=) {
I have tried to use the following code to retrieve the data from the
I use the following code to display list of contacts, and then retrieve contact
I use the following code in order to check if certin user exists in
I use the following code to create countdowns in Javascript. n is the number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.