Jump to content
  • Advertisement
Sign in to follow this  

Multipe views

This topic is 2465 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


I have been setting up a multi monitor framework, that is, I am rendering to multiple outputs on multiple adapters, with one device per adapter and one swapchain per output.
Each output additionally has its own backbuffer and zBuffer.

I do not want clones of the scene, which is working fine so far.
Instead, I want the scene to span the entire area spanned by all monitors ( easy to get as DXGI_OUTPUT_DESC).

So naturally, my thought was to use and set a different viewport before each Draw call.
But what it does instead, is clipping my scene to the size of, what it seems, is my back buffer (On a screen of 1280x1024, if I set viewport.TopLeftX = -640;
my scene gets clipped vertically in the middle, showing only the left half)

It seems to me now, I could be creating a larger back buffer, but for n outputs I would at least let a (n-1)th of the buffer go to waste, while I seriously doubt most devices could create buffers that large.

Am I right?

Second, I might have to vary the camera matrix or the projection matrix (or even both?) for each render call, but I am a bit clueless as to how this should be done.
Currently my cam matrix is generated using D3DXMatrixLookAtLH .
To vary for a different viewport, I would have to multiply a Translation onto it for sure. I think, the translation in screen coordinates would be the vector from the center of the first monitor to the center of a second.
But then? How do I get this 2d translation into my 3d view space?

Or should it be entirely different?
Thanks for your help.

Just a small edit:
I reconsidered the part with different views, and came to the conclusion, that my program could only benefit from this, if the user actually ordered the displays in a circle around them.

So after a bit more experimenting, I think my desired result could be achieved using different projectionMatrices for each output.
I maybe could use D3DXMatrixPerspectiveOffCenterLH to render for different monitors.
Then I would have to specify different view volumes. Here's where I'm lost at now:

I should once calculate the entire bounding box of all view volumes, maybe determine the barycentre of the view volumes, make this barycentre origin of an additional coordinate system, so that it can be the vanishing point for all windows, and then express all view volumes relative to this origin?? Edited by osiris11

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!