Blending OGRE (via MOGRE) into a WPF application

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Mawen
Halfling
Posts: 54
Joined: Wed Jun 04, 2003 7:34 pm
Location: Calgary, Canada
Contact:

Re: Blending OGRE (via MOGRE) into a WPF application

Post by Mawen »

Hi everyone,

Just letting you know I put up some code and a test/benchmarking app on an open source repository: https://bitbucket.org/JaredThirsk/mogreinwpf. I hope to develop this further to characterize WPF+Ogre performance and get a good understanding of it. Contributions / comments / experiences are welcome.
pjcast wrote:Well, while the framerates are substantially lower, at least there still within reason. But, yeah, I've noticed WPF + DIrect3D to be a lot slower than using all native - not sure if there are any optimizations one can make (outside of MS) as the bottleneck seems to be the surface copy.
This Ogre FPS rate may be bogus in practice (it is not the draw rate to the screen, but to the texture), but I thought I would share it in case you find it interesting:

Image

Also, I noticed Mathieu from this comment here had some very interesting experiences and comments: http://www.codeproject.com/KB/WPF/OgreI ... x3416428xx
(aka Meharin) Mogre (1.7.1) .NET 4, GUI: WPF (see https://bitbucket.org/JaredThirsk/mogreinwpf), Net: Lidgren+custom RPC+MessagePack, Sound: MOgreFreeSL, Physics: BulletSharp, with MeshStrider and partially working DebugDraw [and soon Input: MOIS]
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Blending OGRE (via MOGRE) into a WPF application

Post by jacmoe »

You might be interested in reading this:
http://code4k.blogspot.com/2011/03/benc ... is-vs.html :)
But, good and interesting news none the less.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Mawen
Halfling
Posts: 54
Joined: Wed Jun 04, 2003 7:34 pm
Location: Calgary, Canada
Contact:

Re: Blending OGRE (via MOGRE) into a WPF application

Post by Mawen »

jacmoe wrote:You might be interested in reading this:
http://code4k.blogspot.com/2011/03/benc ... is-vs.html :)
Thanks for the link! Very interesting. I am not sure how much it directly relates to Mogre, as I understand the D3D calls are still in native C++, as suggested by the URL:
Benchmark article wrote:"And if you really want to circumvent this interop cost for chatty API scenarios, you can design your engine to call a native function that will batch calls to the Direct3D native API."
Still, marshalling C# calls to C++ (like moving lots of entities every frame) is going to incur the sort of marshalling penalty described by the article.
(aka Meharin) Mogre (1.7.1) .NET 4, GUI: WPF (see https://bitbucket.org/JaredThirsk/mogreinwpf), Net: Lidgren+custom RPC+MessagePack, Sound: MOgreFreeSL, Physics: BulletSharp, with MeshStrider and partially working DebugDraw [and soon Input: MOIS]
Mawen
Halfling
Posts: 54
Joined: Wed Jun 04, 2003 7:34 pm
Location: Calgary, Canada
Contact:

Re: Blending OGRE (via MOGRE) into a WPF application

Post by Mawen »

A couple notes:
  • I also created a fork of Ogre for the sole purpose of porting Direct3D9 to 9Ex, which gives a huge (2.5+ times) performance boost in this scenario for large textures (and perhaps others involving render to texture?) I got it working and you can find my source changes here: https://bitbucket.org/JaredThirsk/ogre-d3d9ex, with precompiled Mogre binaries in the https://bitbucket.org/JaredThirsk/mogreinwpf project. I am a total noob to D3D progamming, and don't know what issues there may be, but the changes seem trivial/minimal (basically, don't use D3DPOOL_MANAGED), and I wonder if it makes sense for Ogre to officially support 9Ex via config flags on the Direct3D9 plugin (i.e. at first: 9Ex is optional, with an optional fallback to 9. And once (and if) 9Ex seems stable and beneficial, use it by default, with the D3D9 fallback for WinXP or XPDM drivers on Vista/Win7.)
  • I have been posting more thoughts and screenshots to the current WPF thread on the Mogre forum: http://www.ogre3d.org/addonforums/viewt ... =8&t=14094 be sure to check over there if you are interested in following this.
(aka Meharin) Mogre (1.7.1) .NET 4, GUI: WPF (see https://bitbucket.org/JaredThirsk/mogreinwpf), Net: Lidgren+custom RPC+MessagePack, Sound: MOgreFreeSL, Physics: BulletSharp, with MeshStrider and partially working DebugDraw [and soon Input: MOIS]
Post Reply