Split Screen Programming

Started by
5 comments, last by oliii 15 years, 11 months ago
Hello, I am currently programming a "Tron" like game, with two superbikes driving around a set arena, I would like to have a camera follow each of the two players. Is there a tutorial/guide I can look at, or any helpful advice would be great, thanks!
Advertisement
OpenGL, DirectX?
In DirectX, apart from swap chains, you can use view ports
[ my blog ]
In OpenGL, viewports are very trivial to set up and use. All you need to is provide the corner and dimensions to glViewport(), and then give the correct aspect ratio (width/height) when generating your perspective projection.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
Just to clarify - viewports are not restricted to OGL/DX. "Viewport" is simply a term used to describe the use of cameras in a game scene. So you have a single scene that contains all of your objects, so in your case your scene would have the two bikes, your grid-like environment (arena) and any walls already created by the superbikes as they race around. That single scene can then be rendered from multiple angles with viewports. When you set the parameters for a viewport, you're deciding what the player can see from a certain location in the scene. So for split-screen, you have two viewports side by side rendering separate viewpoints of the scene. Just imagine it like those security camera monitors, the ones where you see 4 images on one screen, but they're all of the same room, just different angles.

Drew Sikora
Executive Producer
GameDev.net

Thanks for the help!

I got split screen working in DirectX, but I am having problems with getting my cameras to show everything properly, I am not sure what is wrong as I tried using the projection matrix with the same viewport settings, and with different viewport settings, all I want is first to show the same bike (both cameras pointing at 1 bike at the moment) in correct dimensions on both top and bottom, but only the top is working properly.

DirectX Screenshot
Lol, did you play KH2? That was a good bike mini game.
-Jedimace1My company siteEmber StudiosAlmost Done
that doesn't look too far off. This looks like a aspect ratio / fov problem. Check those values in the two projection matrices, they should be identical.

Everything is better with Metal.

This topic is closed to new replies.

Advertisement