I've seen that there are some forks that patch the D3D9 Rendersystem to create an D3D9Ex device instead.
E.g. here: https://bitbucket.org/JaredThirsk/ogre-d3d9ex/wiki/Home
and here: https://bitbucket.org/nryan/ogre
Is there any chance that mainline Ogre will include a way to choose D3D9Ex? 99% of the code is identical, so I believe it would probably be best to make some global config setting and pass a Parameter to the RenderSystem ctor in D3DPlugin.cpp.
Or what do you think? Clone the whole RenderSystem for the 10 or so lines changed to have clear separation?
Direct3D9Ex Render System
-
- OGRE Team Member
- Posts: 1525
- Joined: Fri Feb 03, 2006 10:37 pm
- Location: Austria - Leoben
- x 100
-
- Gnoblar
- Posts: 10
- Joined: Fri Oct 19, 2012 5:22 pm
Re: Direct3D9Ex Render System
Wow, great.
-
- Ogre Magi
- Posts: 1137
- Joined: Mon May 07, 2007 3:43 am
- Location: Ossining, New York
- x 13
Re: Direct3D9Ex Render System
Why would one want to use this, out of interest?
-
- OGRE Expert User
- Posts: 1920
- Joined: Sun Feb 19, 2012 9:24 pm
- Location: Russia
- x 201
Re: Direct3D9Ex Render System
For one thing it's simply faster on Windows Vista and later because DWM doesn't have to store the copy of your render surface and blit it every time during the final composition. D3D9Ex lets DWM work straight with your render surface. That also spares the memory for the otherwise required surface copy. That's what I know but maybe there's some other improvement.
-
- Ogre Magi
- Posts: 1137
- Joined: Mon May 07, 2007 3:43 am
- Location: Ossining, New York
- x 13
Re: Direct3D9Ex Render System
So does this only make a difference in windowed mode or something like that?
-
- OGRE Expert User
- Posts: 1920
- Joined: Sun Feb 19, 2012 9:24 pm
- Location: Russia
- x 201
Re: Direct3D9Ex Render System
Yeah, I'd think so.
-
- Gnoblar
- Posts: 10
- Joined: Fri Oct 19, 2012 5:22 pm
Re: Direct3D9Ex Render System
I need it to have efficient integration with WPF (Windows Presentation Foundation)-based User Interfaces. bstone's post above explains the technical background.sparkprime wrote:Why would one want to use this, out of interest?
-
- OGRE Expert User
- Posts: 1920
- Joined: Sun Feb 19, 2012 9:24 pm
- Location: Russia
- x 201
Re: Direct3D9Ex Render System
Huh, now I'm curious - is your project .net based? Using WPF in a C++ project is a sea of pain 

-
- Gnoblar
- Posts: 10
- Joined: Fri Oct 19, 2012 5:22 pm
Re: Direct3D9Ex Render System
We have the GUI and related code in C#, and the rendering part in C++. We use Ogre directly, that's also why we didn't use the MOGRE/Wpf integration stuff.
Using C++/CLR, it's quite easy and nice to interop.
Using C++/CLR, it's quite easy and nice to interop.
-
- Halfling
- Posts: 86
- Joined: Tue Sep 01, 2009 7:15 pm
- Location: Cologne, Germany
- x 4
Re: Direct3D9Ex Render System
Would this also improve performance for blitting a RenderTexture to an Image via Ogre::RenderTarget::copyContentsToMemory and/or Ogre::HardwarePixelBuffer::blitToMemory?
-
- OGRE Expert User
- Posts: 1920
- Joined: Sun Feb 19, 2012 9:24 pm
- Location: Russia
- x 201
Re: Direct3D9Ex Render System
Nope, the whole point is that DWM doesn't have to copy application's surface to memory for compositing. With D3D9Ex it can do that directly in the video memory.