Direct3D9Ex Render System

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
jpho
Gnoblar
Posts: 10
Joined: Fri Oct 19, 2012 5:22 pm

Direct3D9Ex Render System

Post by jpho »

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?
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 99
Contact:

Re: Direct3D9Ex Render System

Post by Wolfmanfx »

Its already added by mattan its a config option
jpho
Gnoblar
Posts: 10
Joined: Fri Oct 19, 2012 5:22 pm

Re: Direct3D9Ex Render System

Post by jpho »

Wow, great.
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: Direct3D9Ex Render System

Post by sparkprime »

Why would one want to use this, out of interest?
bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia
x 201

Re: Direct3D9Ex Render System

Post by bstone »

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.
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: Direct3D9Ex Render System

Post by sparkprime »

So does this only make a difference in windowed mode or something like that?
bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia
x 201

Re: Direct3D9Ex Render System

Post by bstone »

Yeah, I'd think so.
jpho
Gnoblar
Posts: 10
Joined: Fri Oct 19, 2012 5:22 pm

Re: Direct3D9Ex Render System

Post by jpho »

sparkprime wrote:Why would one want to use this, out of interest?
I need it to have efficient integration with WPF (Windows Presentation Foundation)-based User Interfaces. bstone's post above explains the technical background.
bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia
x 201

Re: Direct3D9Ex Render System

Post by bstone »

Huh, now I'm curious - is your project .net based? Using WPF in a C++ project is a sea of pain :wink:
jpho
Gnoblar
Posts: 10
Joined: Fri Oct 19, 2012 5:22 pm

Re: Direct3D9Ex Render System

Post by jpho »

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.
FlorianGeorge
Halfling
Posts: 86
Joined: Tue Sep 01, 2009 7:15 pm
Location: Cologne, Germany
x 4

Re: Direct3D9Ex Render System

Post by FlorianGeorge »

Would this also improve performance for blitting a RenderTexture to an Image via Ogre::RenderTarget::copyContentsToMemory and/or Ogre::HardwarePixelBuffer::blitToMemory?
bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia
x 201

Re: Direct3D9Ex Render System

Post by bstone »

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.
Post Reply