multi-screen rendering

Started by
7 comments, last by @xi@g@me 13 years, 9 months ago
Hi everyone :)

It's my first post here, and I'm glad to enter in this community (and also hope my English will be understandable '^^)

Here is my problem : since last year, I followed a course about graphics programming, and especially about direct3D. I become familiar to this library now, and wish to try something new. A new screen is about to arrive in a few days, and I want to do a small multi-monitor rendering technical demo.

But the problem is, if I remember well, we have to choose an adapter when creating a device. I think then I'll have to instantiate more than one device for the purpose I'm targeting. The questions are :

Do I really need to instantiate different devices?
If not, how can I do?
If yes, How can I render a full single scene on multiple monitors? Do I have to do multiple renders steps with different view matrices, or may I render in a big render target surface and then draw on all monitors?

I thank you all in advance for your tips :)
Advertisement
If the displays are connected to the same physical adapter you only need one device but multiple swap chains (one per display).As each swap chain have separated back and front buffers you can’t render in one single step. You need to render the scene segment for each display by its own.

The details depend on the API version you use.

There is some hardware out there that tells Direct3D that multiple displays are just one (ex Eyefinity from AMD). If you use one of these there is no difference to normal full screen rendering. You can just use higher resolutions.

Hi demirug, and thanks for your quick answer :)

Oops I forgot to mention I work with direct3D 9 '^^(for now, after I think I gonna try the direct3D 11 API)

Ok, so an adapter is a graphics card but not a monitor, and I can have two monitors on a single adapter. If I have four screens with two graphics cards, then I need to instantiate two devices, and two swap chains per device. right? (It's just a question, I don't own think kind of hardware :D)
Yes, one device per graphics card and one swap chain per display.

For Direct39 the whole thing is a little bit confusing. It enumerates the displays as adapters. To know which of these adapters (displays) are connected to the same graphics adapter you need to get the caps. Then check MasterAdapterOrdinal, AdapterOrdinalInGroup and NumberOfAdaptersInGroup.

In full screen mode the swap chains need to be created together during CreateDevice. Therefore you need multiple present parameters. Check the documentation for D3DCREATE_ADAPTERGROUP_DEVICE.

I've worked on 2 games, one DX/C++ and one XNA, that were tested on a triple monitor setup and both worked perfectly out out the box with no special programming. AFAIK if there is only 1 device (multiple monitor in 1 GPU or hardware like Matrox Triple Head) everything should work.

I've never personally tested on SLI setups, so not sure about that. Never had any complaints that either game didn't work on SLI though. You'd think that SLI setups would emulate a single device to applications to make it work with any app. Not sure though.
OK, thank you for all of this info :) I'll try as soon as I get the screen and I tell you what it becomes.

Another point : do the Direct3D API gives us functionality to detect the monitors position on the desktop, or do I have to use son windows.h stuff? (how I love msdn documentation ! *sigh*) I mean, for example two monitors with not the same resolution, one is left and the other right, and they are aligned by top, or by bottom, or even not aligned, etc.
Quote:Original post by @xi@g@me
Another point : do the Direct3D API gives us functionality to detect the monitors position on the desktop, or do I have to use son windows.h stuff? (how I love msdn documentation ! *sigh*) I mean, for example two monitors with not the same resolution, one is left and the other right, and they are aligned by top, or by bottom, or even not aligned, etc.


Direct3D9 gives you only the monitor handle.

DXGI (used by 10 and up) can give you the rectangle on the virtual desktop that is shown on a display.

Quote:Original post by Demirug
There is some hardware out there that tells Direct3D that multiple displays are just one (ex Eyefinity from AMD). If you use one of these there is no difference to normal full screen rendering. You can just use higher resolutions.


That can be done also by Windows, on any hardware (well I think the two monitors must be same in this case, or at least to have the same resolution, naturally). When you set it in windows to set two monitors not as separate desktops but as horizontal/vertical span, you'll also get one big monitor with for example 2560x1024 resolution. I, however, don't know how much is this related to graphic drivers and I've used it (successfully with various monitors, also with stereoscopic glasses with two separate VGA inputs) always only on nVidia GCs.

Oh - and I think I've heard somewhere this was not possible on Vista and above? Have no way how to verify this.
Quote:Original post by Demirug
Direct3D9 gives you only the monitor handle.

DXGI (used by 10 and up) can give you the rectangle on the virtual desktop that is shown on a display.


The screen positioning feature is available since long now, I think DXGI uses system calls for that, I think I can find them out (I'll have a look).

to EJH (hi ^^) : if you have a SLI configuration with 2 GCs and two outputs each, you can only use two screens (on the same card, the one which is SLI centered). If you plug a third screen on the other GC, the SLI mode will be disabled and you will have three different screens. That is, your system will recognize two graphics adapter, instead of one with SLI mode.

This topic is closed to new replies.

Advertisement