[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 »

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
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

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
KevinMulder
Kobold
Posts: 28
Joined: Sat Sep 06, 2008 1:25 am

Post by KevinMulder »

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.
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
x 3
Contact:

Post by Praetor »

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.
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Post by Thieum »

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)
TMT
Halfling
Posts: 59
Joined: Thu Aug 23, 2007 8:09 pm

Post by TMT »

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.
KevinMulder
Kobold
Posts: 28
Joined: Sat Sep 06, 2008 1:25 am

Post by KevinMulder »

That would be a great help.
--
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 »

Okay, it's under a different tracker number (2107384) as I could not add a file to the other (1692979).
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Post by Thieum »

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 ?
KevinMulder
Kobold
Posts: 28
Joined: Sat Sep 06, 2008 1:25 am

Post by KevinMulder »

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!
--
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 »

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.
TMT
Halfling
Posts: 59
Joined: Thu Aug 23, 2007 8:09 pm

Post by TMT »

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.
Entropai
Kobold
Posts: 30
Joined: Fri Jan 19, 2007 10:42 am

Post by Entropai »

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
TMT
Halfling
Posts: 59
Joined: Thu Aug 23, 2007 8:09 pm

Post by TMT »

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.
Entropai
Kobold
Posts: 30
Joined: Fri Jan 19, 2007 10:42 am

Post by Entropai »

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.
TMT
Halfling
Posts: 59
Joined: Thu Aug 23, 2007 8:09 pm

Post by TMT »

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.
Entropai
Kobold
Posts: 30
Joined: Fri Jan 19, 2007 10:42 am

Post by Entropai »

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.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

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.
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
x 76

Post by Assaf Raman »

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.
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
x 2
Contact:

Multihead patch 1.6

Post by Nir Hasson »

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...
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Post by Thieum »

Cool!

Do you plan to keep the "createMultiheadWindows" method or enable multiple calls to createWindow with the fullscreen parameter set to true ?
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
x 2
Contact:

Post by Nir Hasson »

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.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

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

Post by Assaf Raman »

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.
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
x 2
Contact:

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

Post by Nir Hasson »

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
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

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

Post by Assaf Raman »

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