Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

GraphicsDevice.GetBackBufferData is sloooow

$
0
0

@dmanning23 wrote:

Hi all! So what I've been working on is a thing that records gameplay, and then at the end of the game compresses it to an animated gif, which the player can then share on social media. It's coming along great and it's nearly there, but I've ran into a few wrinkles...

The way I'm currently recording gameplay is by grabbing a screenshot using GraphicDevice.GetBackBufferData(). It works great on desktop because there is horsepower to spare, but on android/iOS the performance is in the toilet. As soon as I turn the recorder on, I get a janky frame everytime it calls GetBackBufferData. I tried to cheat and wrap it in Task.Run to pitch to a separate task, which fixes the performance issue but on opengl platforms it grabs a blank screen.

My next step is to try spinning up a dedicated BackgroundWorker to grab screenshots, maybe that will work but I don't really have my hopes up. Does anyone have a better idea? Is there some other technique that would be better than GetBackBufferData? Is there a way to speed it up?

You can check it out here if you want:
https://github.com/dmanning23/MonogameScreenTools

and here is a full-blown example game using it:
https://github.com/dmanning23/MonogameScreenToolsExample

Cheers!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles