I want to dump raw texture data to disk (to read back later), and I’m not sure about glReadPixel will read from the currently bound texture.
How can I read the buffer from my texture?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
glReadPixels function reads from framebuffers, not textures. To read a texture object you must use glGetTexImage but it isn’t available in OpenGL ES 🙁
If you want to read the buffer from your texture then you can bind it to an FBO (FrameBuffer Object) and use glReadPixels:
Then, you only must call to glReadPixels when you want to read from your texture: