Click or drag to resize
DigitalRuneRelease 2015-12-19
Release notes

DigitalRune Graphics and MonoGame

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.)

DigitalRune Graphics and UWP

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.

WPF interoperability

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:

Loop frame for cyclic animations

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.

Breaking change

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.

Change log

DigitalRune Base 1.19

DigitalRune Mathematics 1.14

DigitalRune Geometry 1.18.1

  • CHANGE: Improved height field contacts at height field borders.

DigitalRune Animation 1.4.1

DigitalRune Graphics 1.1

DigitalRune Game UI 1.6.2

  • CHANGE: In MonoGame the MaxNumberOfPlayers now depends on the platform. Previously the property always returned 4.
  • FIX: LayoutSerializer did not deserialize certain properties on iOS and UWP.

Samples

  • NEW: CollisionFilterSample shows how to enable/disable collisions using filters.
  • NEW: SpatialPartitionSample shows how to use spatial partitions (e.g. bounding volume trees).
  • NEW: HealthBarSample shows how to position a UIControl relative to a 3D object to display a 2D health bar.
  • NEW: ProjectedShadowSample shows how to create planar projected shadows using a custom scene node renderer.
  • NEW: ProjectedShadowSample2 shows how to create planar projected shadows using a custom render pass, custom effect and custom effect parameter bindings.
  • CHANGE: The Direct3D debug layer is now disabled by default to improve performance in DEBUG builds. See SampleGame.cs.
  • CHANGE: Startup sample is now set in SampleGame.cs and not in SampleFramework.cs.
  • CHANGE: Disable mipmaps in TerrainSample to improve performance. (Terrain mipmaps are only required for anisotropic filtering on AMD GPUs. Mipmap generation is unnecessarily expensive.)
  • CHANGE: Use POSITION semantic instead of SV_Position for vertex shader input.
  • Minor other improvements.

MonoGame

  • NEW: OcclusionQuery implemented for DirectX.
  • NEW: Mipmap generation for render targets is now implemented.
  • NEW: GraphicsDevice.SetVertexBuffers implemented for DirectX.
  • NEW: GraphicsDevice.DrawInstancedPrimitives implemented for DirectX.
  • FIX: AccessViolationException in X3DAudio.Calculate.
  • FIX: Do not build external references "Asset_0" if the asset is included directly in the content project and explicitly built as "Asset" (no suffix).
  • Minor other improvements.