Concept: Switch MP2 to D3D11/D2D rendering (1 Viewer)

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    This thread is about discussion of the idea to switch MP2 rendering to a newer DX version.

    The current situation (as of 12/2014) is:
    • MP2 SkinEngine uses D3D9Ex for all rendering (SharpDX 2.6.2)
    • Video playback uses DirectShow (incl. DXVA) with a "Custom EVR Presenter". This requires a D3D9(Ex) device.
    • Visuals (controls), Brushes (SolidColor, LinearGradient, RadialGradient), Paths and Geometries are all created and rendered manually (software based triangulation)
    MP2_Current_SkinEngine_D3D9Ex.PNG

    There are a number of limitations:

    1. Own implementation of many code parts are not fully compatible to the WPF known controls (i.e. Path syntax limited, line join modes not fully implemented)
    2. Text rendering is not as flexible as required (only simple font, no switch between normal, italic, bold), features missing like line height adjustment. Right-to-left support is WiP (based already partly on D2D techology)
    3. Control rendering (lines) is aliased. The available MultiSampling-AntiAliasing (MSAA) has some own propblems and performance drops
    4. Often requested rendering effects are not available (mostly blur and shadows)

    Proposal
    I'd like to switch MP2 rendering to Direct3D11(.1). This allows us to use Direct2D for rendering of visuals and effects. Video playback will still require a Direct3D9(Ex) device.

    Both D3D APIs can interoperate with each other. As we are already copying the Video frame as texture into our VideoBrush, the technology chain won't change so much.

    Compatibility with Windows 7 (with platform update) is mandatory in the design decision.

    The switch could solve all the limitations listed above. We would get a lot more features (effects), a better rendering quality (per-primitive anti aliasing), maybe(!) better performance (hardware tesselation vs. software triangulation), a better compatibility with other tools (see WPF, D2D) and more.

    The proposed archtitecture looks like:
    MP2_Proposed_D3D11_D2D.PNG

    The work on this project has a quite big impact on SkinEngine and will take a lot of development, testing and bugfixing until we get the same features as we have now.

    I'd like to put this idea to discussion, what other things need to be considered, what other concerns exists?

    [USERGROUP=39][USERGROUP=39][USERGROUP=39][USERGROUP=39][USERGROUP=39][USERGROUP=39][USERGROUP=39][USERGROUP=39][USERGROUP=39][USERGROUP=39]@Developers[/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP] [USERGROUP=40][USERGROUP=40][USERGROUP=40][USERGROUP=40][USERGROUP=40][USERGROUP=40][USERGROUP=40][USERGROUP=40][USERGROUP=40][USERGROUP=40]@Testers[/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP] [USERGROUP=38][USERGROUP=38][USERGROUP=38][USERGROUP=38][USERGROUP=38][USERGROUP=38][USERGROUP=38][USERGROUP=38][USERGROUP=38][USERGROUP=38]@Designers[/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP][/USERGROUP]

    Download:
    2015-01-02 Testbuild 1:
    Attached testbuilds are using DX11 + D2D rendering and included changes from latest weekly build. There are some things still missing like:

    • Effects (GUI, no filter in video rendering)
    • Image transition rendering (i.e. ImagePlayer slideshow)
    2015-01-03 Testbuild 2:
    • New: Effects (Shadow, Blur), used in Apollo One
    • New: Quality settings (Settings->Appearance: Antialiasing, Image scaling, Video scaling)
    • Broken: Image player
    2015-01-06 Testbuild 3:
    • Bugfix and optimization of Effects rendering: enabling caching improves performance a lot (only for static content!)
    • Changed visuals: a rounded Rectangle filled by a VisualBrush is faster than an OpacityMask applied to a Grid.
    • Still broken: Image player
    2015-03-06 Testbuild 4:
    • Restored effects based video rendering (using custom SharpDX build now)
    • Image rendering working in general, few bugs expected though
    • ImagePlayer works, but transitions between images are not yet working again
    • Note to Windows 7 users: please extract the additional plugin (20150306-Win7_Compatibility) the MP2-Client folder of this testbuild. It contains a renamed D3DCompiler_43.dll to match Win8 SDK requirements (_47.dll, but this is Win8 only :()
    2015-05-02 Testbuild 5: (Updated 2015-05-06)
    • ImagePlayer works, but transitions between images are still not working
    • Note to Windows 7 users: please extract the additional plugin (20150306-Win7_Compatibility) the MP2-Client folder of this testbuild. It contains a renamed D3DCompiler_43.dll to match Win8 SDK requirements (_47.dll, but this is Win8 only :()
    • BlueVision skin D2D build added
    2017-03-29 Testbuild 6, based on MP2.1 pre2
    • All changes from the MP2.1 pre 2 release are now included in this snapshot.
    References:
     
    Last edited:

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,554
    3,936
    Lehmden
    Home Country
    Germany Germany
    Hi.
    I'm not that familiar with all those DX stuff. But I have a concern about the required hardware then. As example, in my bedroom I'm still using a CRT TV (and this will stay as it is for some more years) and for this I need a GFX card with TV-Out. Those are all older cards which are not DX11 capable... If I understand this right, I can't use MP2 in the bedroom any longer if this switch is done?
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #3
    Good point.
    DX11 as API is able to limit features access to lower DX version (also 9). http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876(v=vs.85).aspx. This would mean older devices are still supported, only exclusive features are not available.

    I found this: http://en.wikipedia.org/wiki/Direct2D about OS requirements. Unfortunately the D2D Effects seems to be exclusive on Win8.1. Would be bad
    Win7 Platform update supports D2D effects: http://msdn.microsoft.com/en-us/library/windows/desktop/jj863687(v=vs.85).aspx
     
    Last edited:

    wizard123

    Retired Team Member
  • Premium Supporter
  • January 24, 2012
    2,569
    2,680
    Home Country
    United Kingdom United Kingdom
    I would say now is the time to upgrade and move forward if your going to otherwise MP2 will get stuck with old technology before it's even taken off.
     

    MrTechno

    Retired Team Member
  • Premium Supporter
  • February 27, 2011
    1,256
    511
    London
    Home Country
    United Kingdom United Kingdom
    Can the installer check that all the prerequisites are installed? It probably doesn't matter for a machine you built a long time ago but I've just wiped two Win7 machines and I noticed MP2-Setup doesn't check for VC++ 2010 / 2013 runtimes (it does check for DX9 and refused to run until I'd got that).
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,554
    3,936
    Lehmden
    Home Country
    Germany Germany
    I would say now is the time to upgrade and move forward if your going to otherwise MP2 will get stuck with old technology before it's even taken off.
    Normally I fully agree with that, but DX11 really is a huge cut regarding Hardware. Imagine all those Ion based boxes out there (maximum DX10.1) or all the people who don't want to use 2014th hardware just for a media player.... Other solutions are heading for lower hardware requirements (e.g Raspberry Pi and XBMC) and we will lock out all hardware that is not "state of the art" at this moment... Even my working PC (on which I do most of the MP2 testing) isn't capable of DX11 as it's 3 years old. Only my main HTPC has 2014 hardware that is DX11 enabled. So I'm not sure how much testing I'll be able to do in future if I can't do this on my hardware at all...
     

    wizard123

    Retired Team Member
  • Premium Supporter
  • January 24, 2012
    2,569
    2,680
    Home Country
    United Kingdom United Kingdom
    morpheus_xx already stated older hardware would still be supported they just would not have the new advanced features.
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,554
    3,936
    Lehmden
    Home Country
    Germany Germany
    just would not have the new advanced features.
    How do I have to understand that? Are the GUI only half drawn or am I missing some fancy shadows only? Overall it's a matter how much of the GUI is not as it should be if I only have a DX10 GPU...
     

    wizard123

    Retired Team Member
  • Premium Supporter
  • January 24, 2012
    2,569
    2,680
    Home Country
    United Kingdom United Kingdom
    I'm sure morph can confirm but i would assume you would only miss the new pretty things like effects or lighting/shadows etc
     

    Users who are viewing this thread

    Top Bottom