[Solved] multihead/multiscreen in mainstream 1.6 (DirectX)

What it says on the tin: a place to discuss proposed new features.
KevinMulder
Kobold
Posts: 28
Joined: Sat Sep 06, 2008 1:25 am

[Solved] multihead/multiscreen in mainstream 1.6 (DirectX)

Post by KevinMulder » Sat Sep 06, 2008 12:34 pm

Hi!

Sorry if I missed something although I spent my last 4 days of searching resolution for multihead + Ogre 1.6 combo. No success. The old source (1.4.9) is not patching well with bugrtracked multihead patch.

Is anyone working on it? There is no code snippets, patch or any trace about it. Any plan or ideas for it?

Thanks,
Kevin
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

Post by sinbad » Sun Sep 07, 2008 11:13 pm

This is one of those things that's been in the wings mostly, because I don't think anyone on the team has a multihead setup (I know I don't).

Anyone wanna buy me another monitor? ;)

When you say the patch isn't working, are you using the one from the patch tracker? http://sourceforge.net/tracker/index.ph ... tid=302997
0 x

KevinMulder
Kobold
Posts: 28
Joined: Sat Sep 06, 2008 1:25 am

Post by KevinMulder » Mon Sep 08, 2008 8:52 am

Yes. I tried that patch. It does not patch to 1.6 nicely. I will look after the details and try to port the patch to 1.6 after 25/09/2008 if noone else is working on it.

Also, I have a 3 screen (2x9800GT, 1xGTX280) system. So if You want to test anything, let me know.
0 x

User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
Contact:

Post by Praetor » Mon Sep 08, 2008 12:07 pm

I may be getting a setup like this for a job I'm doing soon. I'm still a bit fuzzy on the hardware setup I'll need, but it might help this out a lot.
0 x

User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
Contact:

Post by Thieum » Mon Sep 08, 2008 4:46 pm

The patch doesn't support multiple cards anyway. (because I could not found a pci (not express) nvidia directx9 card)

(Oops, I was referring to this multihead patch, not the one linked by sinbad)
0 x

TMT
Halfling
Posts: 59
Joined: Thu Aug 23, 2007 8:09 pm

Post by TMT » Thu Sep 11, 2008 11:49 pm

I've got the patch Thieum linked to in 1.4.9. It also has my version of the patch that sinbad linked to...I just prepend the adapter ordinal to each D3DDriver instance name to make them unique. I'll try to package that up for whoever needs it and submit or post shortly.
0 x

KevinMulder
Kobold
Posts: 28
Joined: Sat Sep 06, 2008 1:25 am

Post by KevinMulder » Fri Sep 12, 2008 7:53 am

That would be a great help.
0 x
--
Where I look onto the night sky watching the stars, I know those are just dead-pixels left around ...

TMT
Halfling
Posts: 59
Joined: Thu Aug 23, 2007 8:09 pm

Post by TMT » Fri Sep 12, 2008 1:39 pm

Okay, it's under a different tracker number (2107384) as I could not add a file to the other (1692979).
0 x

User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
Contact:

Post by Thieum » Fri Sep 12, 2008 2:27 pm

great !

but, too bad you had to open another tracker number. maybe I should add a comment in my tracker number with a link to yours ?
0 x

KevinMulder
Kobold
Posts: 28
Joined: Sat Sep 06, 2008 1:25 am

Post by KevinMulder » Mon Sep 15, 2008 9:58 pm

Can we except this patch to work under 1.6 RC1? Is there anything I can do to help the migration of this patch under 1.6 RC1?

And I would like to thank you for this patch. I really appreciate it!
0 x
--
Where I look onto the night sky watching the stars, I know those are just dead-pixels left around ...

Entropai
Kobold
Posts: 30
Joined: Fri Jan 19, 2007 10:42 am

Post by Entropai » Tue Sep 16, 2008 10:31 am

TMT wrote:I've got the patch Thieum linked to in 1.4.9. It also has my version of the patch that sinbad linked to...I just prepend the adapter ordinal to each D3DDriver instance name to make them unique. I'll try to package that up for whoever needs it and submit or post shortly.
How does this differ from the previous patch (Thieums), i've been working on the multihead patch for 1.6rc1 and 've gotten it working fine with two monitors, but after that it breaks for not getting the swapchain for the additional monitors (3rd one). DXerror claims that the swapchain ordinal is out of range.
0 x

TMT
Halfling
Posts: 59
Joined: Thu Aug 23, 2007 8:09 pm

Post by TMT » Thu Sep 18, 2008 1:09 am

Entropai,
My patch is mainly just a merge of Thieums into 1.4.9 but I had a system with two exact same gfx cards so I had to add the ordinal to the driver list names in order to choose the correct device at runtime. I am using this on a project with no problems.

Can you explain your exact setup? How many gfx cards and how many monitor ports on each? Are the first two monitors on one card and the third on a second card? If so, it won't work. This series of patches only supports a single card as per D3DCREATE_ADAPTERGROUP_DEVICE capabilities.

To support multiple gfx adapter cards, the D3D9RenderSystem would need to be changed to support creating one Direct3DDevice9 objects for each gfx card and give each device the same rendering resources. Not sure what implications that has on the rest of Ogre. And realize that with D3DCREATE_ADAPTERGROUP_DEVICE, you _must_ create present parameters for _all_ monitors of each adapter.
0 x

Entropai
Kobold
Posts: 30
Joined: Fri Jan 19, 2007 10:42 am

Post by Entropai » Thu Sep 18, 2008 8:14 am

TMT wrote:Entropai,
My patch is mainly just a merge of Thieums into 1.4.9 but I had a system with two exact same gfx cards so I had to add the ordinal to the driver list names in order to choose the correct device at runtime. I am using this on a project with no problems.

Can you explain your exact setup? How many gfx cards and how many monitor ports on each? Are the first two monitors on one card and the third on a second card? If so, it won't work. This series of patches only supports a single card as per D3DCREATE_ADAPTERGROUP_DEVICE capabilities.

To support multiple gfx adapter cards, the D3D9RenderSystem would need to be changed to support creating one Direct3DDevice9 objects for each gfx card and give each device the same rendering resources. Not sure what implications that has on the rest of Ogre. And realize that with D3DCREATE_ADAPTERGROUP_DEVICE, you _must_ create present parameters for _all_ monitors of each adapter.
I have single GFX card (http://uk.asus.com/products.aspx?l1=2&l ... odelmenu=2) with four distinct DVI outputs and i'm trying to get it work with three monitors, each in separate output. It works fine with two monitors and creates windows for the three monitor setup also, but cannot find proper swapchain for the third head (the getswapchain returns HR D3DERR_INVALIDCALL), creating one is not option since you cannot create additional swapchain's in fullscreen mode.
Thanks for the answer
0 x

TMT
Halfling
Posts: 59
Joined: Thu Aug 23, 2007 8:09 pm

Post by TMT » Thu Sep 18, 2008 12:55 pm

Okay, the link tells me all I need to know. You have four monitor ports, but in reality you have essentially two graphics cards sandwiched together. So actually each card has two monitor ports. This is a situation I have been interested in, but haven't checked out myself.

If you run them as separate cards, not in Crossfire mode, then I am sure that you can only get at most two monitor outputs for a single IDirect3DDevice9 object using D3DCREATE_ADAPTERGROUP_DEVICE. However Crossfire mode is the big question. Initially, both AMD's Crossfire and nVidia's SLI modes only supported a single monitor output when enabled. But several months back I read that AMD was going to enable multiple-monitor support in Crossfire mode. I am curious if that is true or not. I could never verify that for sure and could never find a card for sale like the one you have.

You might want to put the card in Crossfire mode and write some code to loop over calls to IDirect3D9::GetDeviceCaps() from 0 to IDirect3D9::GeAdapterCount()-1 and find each D3DCAPS9 where AdapterOrdinalInGroup == 0 and then look at the value of NumberOfAdaptersInGroup. That value will tell you how many monitors opening that adapter in multi-monitor mode supports.

Incidentally, I've read that nVidia's SLI mode is supposed to start supporting multi-monitor this year, but I'm not holding my breath. And it appears that there is some new capability in Dirext3D 10 for multi-monitors, but Ogre is avoiding D3D10, probably for good reason.
0 x

Entropai
Kobold
Posts: 30
Joined: Fri Jan 19, 2007 10:42 am

Post by Entropai » Mon Sep 22, 2008 8:52 am

TMT wrote: If you run them as separate cards, not in Crossfire mode, then I am sure that you can only get at most two monitor outputs for a single IDirect3DDevice9 object using D3DCREATE_ADAPTERGROUP_DEVICE. However Crossfire mode is the big question. Initially, both AMD's Crossfire and nVidia's SLI modes only supported a single monitor output when enabled. But several months back I read that AMD was going to enable multiple-monitor support in Crossfire mode. I am curious if that is true or not. I could never verify that for sure and could never find a card for sale like the one you have.
Okay, after forum searches and few tests, the promised CrossfireX supports multiple monitors but only two at time which is bit of an disappointment :roll:. Without CrossfireX it works just like two separate cards driving max two monitor outputs each in separate device.
TMT wrote: You might want to put the card in Crossfire mode and write some code to loop over calls to IDirect3D9::GetDeviceCaps() from 0 to IDirect3D9::GeAdapterCount()-1 and find each D3DCAPS9 where AdapterOrdinalInGroup == 0 and then look at the value of NumberOfAdaptersInGroup. That value will tell you how many monitors opening that adapter in multi-monitor mode supports.
Thanks for the tip, it helped to confirm previous information. It seems that either serious modification is needed or some other routes to be explored to get four monitors working properly.
0 x

TMT
Halfling
Posts: 59
Joined: Thu Aug 23, 2007 8:09 pm

Post by TMT » Tue Sep 23, 2008 7:11 pm

FWIW, I've been using a 4 monitor setup in Ogre by using a single gfx card with dual monitor outputs and putting 1 monitor on the first output and a Matrox TripleHead2Go on the second output where I have 3 additional monitors connected. I use the mentioned mutlihead patch to make it all work.
0 x

Entropai
Kobold
Posts: 30
Joined: Fri Jan 19, 2007 10:42 am

Post by Entropai » Wed Sep 24, 2008 11:01 am

TMT wrote:FWIW, I've been using a 4 monitor setup in Ogre by using a single gfx card with dual monitor outputs and putting 1 monitor on the first output and a Matrox TripleHead2Go on the second output where I have 3 additional monitors connected. I use the mentioned mutlihead patch to make it all work.
Yes, i wish that would be solution for us too, but since we're using custom tilted resolution (1050x1400) it's not possible (as far i know) to use triplehead2go.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Post by Assaf Raman » Thu Sep 25, 2008 3:01 pm

OK, I had a look at this patch, it still doesn't solve the issue of dragging a window to a different monitor. I will try to think of the best way to solve the issue of supporting more then one monitor.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Post by Assaf Raman » Tue Sep 30, 2008 5:19 pm

Basically from what I can see in the d3d9 documentation you need to create a different device for each adapter if you are not in full screen, if you are in full screen there is a special exclusive mode that enable you to share resources between monitors, but if you are working in the "normal" windowed mode – you need to create each of the resources for each of the adapters\monitors.

So the code needed here is code that creates a device for each adapter that has windows on its monitor, detect that window moved then determine what adapter needs to be its "active adapter".

The code will need to create all the resources on multiple devices and not a single device like we have now.

If we want to optimize the code – we can add also an option to only create a devices for the used monitors – and when a monitor begin to be used in the middle of the run (lets say – a window has been dragged there)– a device will be created and all the resources will be created on that device as well.

This sounds like a lot of work.
0 x
Watch out for my OGRE related tweets here.

User avatar
Nir Hasson
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 363
Joined: Wed Nov 05, 2008 4:40 pm
Location: TLV - Israel
Contact:

Multihead patch 1.6

Post by Nir Hasson » Thu Dec 11, 2008 8:47 pm

I've ported the multihead patch to version 1.6 and the good news are that it's realy give significant performance boost almost 100% - from 20-25 fps to 45-50 fps. There were some issues with OpenGL but I fixed them. I'll post the patch as soon as I get my cont licence.
Currently I'm working on support in generic number of monitors.
In D3D9 RS it means to add support in multiple devices - not so trivial but I'm going to do it anyway.
In OpenGL as much as I know right now the render window implementation should work just fine - there is already render context for each window - if there is a better way to do it I'd like to hear from you.
I'll keep update soon...
0 x

User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
Contact:

Post by Thieum » Sat Dec 13, 2008 3:19 pm

Cool!

Do you plan to keep the "createMultiheadWindows" method or enable multiple calls to createWindow with the fullscreen parameter set to true ?
0 x

User avatar
Nir Hasson
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 363
Joined: Wed Nov 05, 2008 4:40 pm
Location: TLV - Israel
Contact:

Post by Nir Hasson » Sat Dec 13, 2008 9:09 pm

I'm going to modify it to createRenderWindows method - It will extend the createMultiheadWindows in the way that it will allow any number of windowed windows or up to adapter count full screen windows.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: multihead/multiscreen in mainstream 1.6 (mainly DirectX)

Post by Assaf Raman » Fri Dec 26, 2008 6:28 pm

I just committed your changes to the trunk.
You did an excellent job.
Thank for this contribution.
I change a few of your class names to be more like the rest of OGRE but the rest of the patch is all you.
0 x
Watch out for my OGRE related tweets here.

User avatar
Nir Hasson
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 363
Joined: Wed Nov 05, 2008 4:40 pm
Location: TLV - Israel
Contact:

Re: multihead/multiscreen in mainstream 1.6 (mainly DirectX)

Post by Nir Hasson » Mon Dec 29, 2008 3:24 pm

Thanks Assaf :)

I created a patch for 1.6. Anyone who needs this feature can simply download it and apply the patch.
You can get it from here:
https://sourceforge.net/tracker2/?func= ... tid=302997

Nir
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [Solved] multihead/multiscreen in mainstream 1.6 (DirectX)

Post by Assaf Raman » Mon Dec 29, 2008 7:09 pm

This is done as far as I can see.
Thanks Nir.
0 x
Watch out for my OGRE related tweets here.

Post Reply