glCopyTexImage2D as alternative to glReadPixels (OpenGL ES)

前端 未结 1 797
盖世英雄少女心
盖世英雄少女心 2021-01-06 07:30

I\'m currently grabbing a screenshot of an OpenGL ES game using glReadPixels. The screenshots are great however the call to glReadPixels causes a

1条回答
  •  孤城傲影
    2021-01-06 08:23

    The time delay is caused by transferring a large amount of memory between GPU and CPU. This can be solved by transferring in chunks, a little bit per frame. But if you read from the framebuffer over a series of frame, the image would be changing meanwhile.

    So you make a copy, video RAM into video RAM (very fast), and then it won't change as you transfer it piecemeal.

    0 讨论(0)
提交回复
热议问题