开发者

Reduced quality OpenGL ES screenshots (iPhone)

开发者 https://www.devze.com 2023-04-04 08:28 出处:网络
I\'m currently using this method from Apple to take screenshots of my OpenGL ES iPhone game.The screenshots look great.However taking a screenshot causes a small stutter in the game play (which otherw

I'm currently using this method from Apple to take screenshots of my OpenGL ES iPhone game. The screenshots look great. However taking a screenshot causes a small stutter in the game play (which otherwise runs smoothly at 60 fps). How can I modify the meth开发者_StackOverflow中文版od from Apple to take lower quality screenshots (hence eliminating the stutter caused by taking the screenshot)?

Edit #1: the end goal is to create a video of the game play using AVAssetWriter. Perhaps there's a more efficient way to generate the CVPixelBuffers referenced in this SO post.


What is the purpose of the recording?

  • If you want to replay a sequence on the device you can look into saving the object positions etc instead and redraw the sequence in 3D. This also makes it possible to replay sequences from other view positions.

  • If you want to show the game play on i.e. youtube or other you can look into recording the game play with another device/camera or record some game play running in the simulator using some screen capture software as ScreenFlow.


The Apple method uses glReadPixels() which just pulls all the data across from the display buffer, and probably triggers sync barriers, etc, between GPU and CPU. You can't make that part faster or lower resolution.

Are you doing this to create a one-off video? Or are you wanting the user to be able to trigger this behavior in the production code? If the former, you could do all sorts of trickery to speed it up-- render to a smaller size for everything, don't present at all and just capture frames based on a recording of the input data running into the game, or other such tricks, or going even further run that whole simulation at half speed to get all the frames.

I'm less helpful if you need an actual in-game function for this. Perhaps someone else will be.


If all else fails.

Get one of these http://store.apple.com/us/product/MC748ZM/A

And then convert that composite video to digital through some sort of external device. I've done this when I converted vhs movies to dvd a long time ago.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号