Archived

This topic is now archived and is closed to further replies.

MadMechwarrior

Multiple Camera/Split screen rendering

Recommended Posts

Hey, im new to these boards but i''ve been reading them for a while. Anyways I have been expimenting with Split screen rendering the past few days and I thought of 2 ways of doing it. I can either switch the viewport and render the scene twice in pseudo code: BeginScene(); TransformCamera1; Render(); // for main camera SwitchViewport(small screen); TransformCamera2 Render(); SwitchViewport(Full screen); EndScene(); that one works fine but I dont know if it would be faster to make a quad in a corner of the screen and use render to texture. The screen I tested was set up like this: _________________________________ | | | | Cam2 | | |______________| Cam1 | | | | | |________________________________| "Me no sound like yoda... Do I" "Its not easy being green"

Share this post


Link to post
Share on other sites
The method you have, the SetViewport() method is generally faster and is better supported across different hardware.

All the SetViewport does is change the internal values D3D uses to scale and place screen coordinates after transformation into clip space.

A SetRenderTarget call will no doubt cause a flush of rendering.

The only advantage of SetRenderTarget would be if you wanted all of the multiple views to show exactly the same thing. Or maybe for some special effects such as heat haze, refracted glass objects, and possibly depth of field etc.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites