Sign in to follow this  
Mekanikles

Splitscreen problems

Recommended Posts

I'm trying to render a scene onto (or next to) another scene such as a splitscreen or a picture-in-picture effect. Problem is that objects drawn close to the edges will overlap onto the adjacent scene. Is this problem resovled by masking or by setting a new viewport? (I tried setting the viewport, but I got some small artifacts along the edges, also this is cumbersome when using alot of different window resolutions) In a double-whammy sort of question, that's probably related to masking, I'm also wondering how non-rectangular areas are drawn (think the round mini-map in WoW or GTA). thnx /Mekanikles

Share this post


Link to post
Share on other sites
Thnx for the swift reply, I will look into those things :)

I'm still wondering however if rectangular areas is rendered faster using a different viewport (the artifacts can be somewhat reduced/ignored in favour of speed I suppose) or if the Stencil Buffer should be used in those cases as well? Keep in mind that I do not use the Stencil Buffer at all at this point (making a 2d-game).

thnx
/Mekanikles

Share this post


Link to post
Share on other sites
Using the stencil buffer would result in testing the pixels for the whole screen but drawing only there where the stencil test is passed.

I'd suggest different viewports and projection matrices.

Share this post


Link to post
Share on other sites
How about render each scene to a texure, and then render those textures to the final buffer? That way you could also do non-rectangular scenes by modifying the alpha-buffer of each scene-texture before putting them into the final buffer.

Share this post


Link to post
Share on other sites
Normally you would render the main view first. Then changing the viewport and scissor to restrict rendering to a specific subset of the framebuffer. If the main view section is convex you can change it's viewport and scissor settings to exclude the region of the framebuffer that will be written by the second rendering hereby preventing overdraw.
Take a look at glScissor, for example here .

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this