Release 2015-12-19 |
This topic contains the following sections:
A significant effort went into improving MonoGame and implementing missing features, such as occlusion queries, mipmap generation, hardware instancing (GraphicsDevice.DrawInstancedPrimitives), multiple vertex streams (GraphicsDevice.SetVertexBuffers). These changes plus other fixes have been accepted and merged by the MonoGame team. As a result, lens flares, hardware instancing and morph target animations are now supported in MonoGame apps.
(Note: The change log below only lists changes made by the DigitalRune team. All changes made in the official MonoGame repository have also been merged into the DigitalRune repository. For a complete list of changes, please check the official MonoGame project.)
Apps for Universal Windows Platform (UWP) may now run in HiDef profile and make use of advanced graphics. The ID WindowsUniversal has been added to the PlatformID enumeration.
Microsoft released the WPF DirectX Extensions [1][2] to host DirectX 10 and 11 content in WPF applications. Users may wonder how this relates to the WPF interop provided by DigitalRune Graphics.
WPF uses Direct3D 9Ex for rendering. Using the built-in D3DImage [3] source it is possible to display Direct3D 9Ex surfaces directly in WPF. However, hosting Direct3D 11 in WPF is a different matter. While it is possible to share surfaces (render targets) between Direct3D 9Ex and Direct3D 11, accessing shared surfaces is not automatically synchronized. This causes problems when WPF tries to display a surface, while Direct3D 11 is still busy rendering the content.
The solution is to manually synchronize access to surfaces shared between WPF (Direct3D 9Ex) and Direct3D 11. One possible implementation is Microsoft’s surface queue library [4][5]. Unfortunately, all links leading to the official Microsoft sample have been broken for some time (years?) now. Luckily, Microsoft has dug up the old code and released it in the form of the WPF DirectX Extensions.
DigitalRune Graphics does not use the WPF DirectX Extensions for interop. The WPF DirectX Extensions (Microsoft.Wpf.Interop.DirectX.dll) provide a native (C++) and, in our opinion, over-engineered solution. Further, the synchronization in the WPF DirectX Extensions is achieved by blocking the CPU. This greatly reduces performance.
DigitalRune Graphics uses a lightweight, fully managed (SharpDX) implementation. The synchronization is part of the D3DImagePresentationTarget. The D3DImagePresentationTarget allows different modes of synchronization. By default, it tries to block the CPU as little as possible to maintain optimal performance.
For further information, see: D3DImagePresentationTarget
(Note that by settings D3DImagePresentationTarget.IsSynchronized = true, the D3DImagePresentationTarget behaves the same as the WPF DirectX Extensions.)
New in this release is the flag D3DImagePresentationTargetIsFrameReady. This flag can be polled to check whether Direct3D 11 has finished rendering the content.
Furthermore, the D3DImagePresentationTarget now adapts to the Windows DPI settings. When running with high-DPI settings, the D3DImagePresentationTarget will render the Direct3D 11 content in the native resolution for optimal quality.
References:
One addition may come in handy for importing models with cyclic (looping) animations, such as walk cycles. It is now possible to specify AddLoopFrame="True" in the model descriptions (.DRMDL file). This new attribute enables automatic insertion of "loop frames" for animation.
The “loop frame” is the last key frame of a cyclic animation. The last key frame needs to match the first key frame of the animation. Ideally, the loop frame should be exported from the 3D modeling/animation tool. However, some exporters skip the loop frame. Or, in some cases the last key frame does not exactly match the first key frame.
The new setting AddLoopFrame="True" automatically adds a loop frame at the end of the duration and enables smooth transitions.
The setters for FormsPresentationTargetGraphicsService, ElementPresentationTargetGraphicsService, and D3DImagePresentationTargetGraphicsService have been made private. This was an oversight in the original API - the properties were never meant to be set by the user.
This change may cause an error in Windows Forms projects. The Windows Forms designer may try to set the property GraphicsService in the code behind file. If you run into this error, please modify the code behind file and remove the line which sets the property.