Jump to content
  • Advertisement
Sign in to follow this  
AhmedCoeia

OpenGL Reading large texture using glreadpixels solution

This topic is 2003 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using Opengles on ubuntu on embedded platform. I'm trying to do some computer vision on a large texture 1024*1024. I have done some shaders on a larage texture that is coming from a camera, then I wanted to read back the pixels to do some manuiplations.

Using glreadpixels is slow to read the texture that is generated by the shader, so I proposed to copy the whole large texture from the camera to a small quad using an FBO, then use glreadpixesl to read the pixels from that quad, then do the processing on that quad. If I want to show the result, convert again that FBO to a large one.

Basically the idea is to reduce the 1k*1k texture to small quad, do the processing, then render it back to 1k*1k.

Would that solution work ?

Share this post


Link to post
Share on other sites
Advertisement

One of the problem i can see in this problem is that your textures will be down sampled when you apply 1024x1024 to a small quad. If you do not mind losing some information from the texture then that is fine. But if every pixel in that 1k*1k texture is important, then what you are trying to do is not going to work. Because as you downscale you lose information, so when you upscale it back to it's original size you are not going to get back the information you lose. Once it is is gone it is gone.

Edited by BornToCode

Share this post


Link to post
Share on other sites

Can the processing be done on the GPU?  If so there is no need whatsoever to read it back (and the processing itself may well be faster too).

Share this post


Link to post
Share on other sites

I just wanna do some thresholding, and few computer vision technique using fragments shader, then get the resultant in a texture and do few thing like find_contours,..etc which are done on the CPU, so I need the whole texture :/

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!