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 » Fri Nov 02, 2012 12:25 pm

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?
0 x

User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 1
Contact:

Re: Direct3D9Ex Render System

Post by Wolfmanfx » Fri Nov 02, 2012 2:06 pm

Its already added by mattan its a config option
0 x

jpho
Gnoblar
Posts: 10
Joined: Fri Oct 19, 2012 5:22 pm

Re: Direct3D9Ex Render System

Post by jpho » Fri Nov 02, 2012 5:46 pm

Wow, great.
0 x

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

Re: Direct3D9Ex Render System

Post by sparkprime » Fri Nov 02, 2012 6:34 pm

Why would one want to use this, out of interest?
0 x

bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia

Re: Direct3D9Ex Render System

Post by bstone » Fri Nov 02, 2012 6:39 pm

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

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

Re: Direct3D9Ex Render System

Post by sparkprime » Sat Nov 03, 2012 8:55 pm

So does this only make a difference in windowed mode or something like that?
0 x

bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia

Re: Direct3D9Ex Render System

Post by bstone » Sun Nov 04, 2012 6:16 am

Yeah, I'd think so.
0 x

jpho
Gnoblar
Posts: 10
Joined: Fri Oct 19, 2012 5:22 pm

Re: Direct3D9Ex Render System

Post by jpho » Mon Nov 05, 2012 12:19 pm

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

bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia

Re: Direct3D9Ex Render System

Post by bstone » Mon Nov 05, 2012 12:58 pm

Huh, now I'm curious - is your project .net based? Using WPF in a C++ project is a sea of pain :wink:
0 x

jpho
Gnoblar
Posts: 10
Joined: Fri Oct 19, 2012 5:22 pm

Re: Direct3D9Ex Render System

Post by jpho » Mon Nov 05, 2012 2:03 pm

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

FlorianGeorge
Halfling
Posts: 86
Joined: Tue Sep 01, 2009 7:15 pm
Location: Cologne, Germany

Re: Direct3D9Ex Render System

Post by FlorianGeorge » Fri Nov 09, 2012 4:58 pm

Would this also improve performance for blitting a RenderTexture to an Image via Ogre::RenderTarget::copyContentsToMemory and/or Ogre::HardwarePixelBuffer::blitToMemory?
0 x

bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia

Re: Direct3D9Ex Render System

Post by bstone » Fri Nov 09, 2012 5:27 pm

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

Post Reply