Snapshot splitscreen

I’ve had a play around with creating a splitscreen for local multiplayer using a snapshot object. In short I have one display group/scene which I blit alternatively to either the top or bottom of the snapshot, while not modifying the other bit.

One frustrating aspect of this approach is that to create a single splitscreen you have to add your scene to the snapshot, transform it, invalidate the canvas and then wait for the render pass. Then you do the same again to create the other screen. So you’re effectively only updating each screen every other frame which means that for a smooth experience you probably need to be driving the game quite fast. 

However it’s also quite hard to know how quickly you can actually push this. Start on the next screen too quickly and you’ll transform the scene before it’s been rendered to the snapshot and one screen will vanish!

Ideally I’d like to be able to do a single snapshot update for both screens, but that seems to require a duplication of scene objects, which negates the point of using a snapshot. Any ideas of how to get round this? 

Ideally it would be great to be able to set a display group as texture for a quad, or to use texture wrapping + mirroring to duplicate a scene over a snapshot, but I can’t see that being supported. 

Has anyone else tried this and found a more sensible approach?

Hi @tap32,

How about just using containers, where each “side” is a container that occupies half the screen, and thus anything outside of that side is masked? You can them manage items within each container, and avoid using snapshots entirely. Will that do what you need?

Brent

Hi Brent, that was one approach I was thinking about, but I wanted to see if it was possible to do it purely with a single snapshot. Part of me doesn’t like duplicating objects, even though that would probably be a big performance gain.

It feels like it should be possible, but I can’t quite see a way of doing it unless it’s possible to invalidate the canvas multiple times within the same update. Then it would be trivial, you’d just add the group once, invalidate, transform it, add it again and invalidate again. 

Being able to easily duplicate visual elements would be a nice feature, but I assume it’s not so trivial with OpenGL? 

That said, my current approach of updating each screen every other update seems fine to my old eyes.  

http://postimg.org/image/yy4i9t5qr/

Yes the top number is not mirrored

Hi @tap32,

How about just using containers, where each “side” is a container that occupies half the screen, and thus anything outside of that side is masked? You can them manage items within each container, and avoid using snapshots entirely. Will that do what you need?

Brent

Hi Brent, that was one approach I was thinking about, but I wanted to see if it was possible to do it purely with a single snapshot. Part of me doesn’t like duplicating objects, even though that would probably be a big performance gain.

It feels like it should be possible, but I can’t quite see a way of doing it unless it’s possible to invalidate the canvas multiple times within the same update. Then it would be trivial, you’d just add the group once, invalidate, transform it, add it again and invalidate again. 

Being able to easily duplicate visual elements would be a nice feature, but I assume it’s not so trivial with OpenGL? 

That said, my current approach of updating each screen every other update seems fine to my old eyes.  

http://postimg.org/image/yy4i9t5qr/

Yes the top number is not mirrored