简体   繁体   中英

Android: glReadpixels larger than viewport?

I need to capture more pixels than the width of the screen contains to save a higher res image. I figure the only two options are to pack more pixels into the screen with some Matrix command, or to make the actual view larger than the screen (which I don't think is possible.) I should probably make it known that I'm using OpenGL ES 2. Any help?

The technique you're looking for is called Render to Texture . Essentially you create an offscreen framebuffer, and redirect your draw calls to this framebuffer instead of the default.

You can make your framebuffer as big as you want (within hardware limitations).

This looks like a reasonable example:

http://blog.shayanjaved.com/2011/05/13/android-opengl-es-2-0-render-to-texture/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM