Pre loader

DirectX WPF Chart Compatibility

Categories

DirectX WPF Chart Compatibility

SciChart now features an optional DirectX10 based renderer. This is currently included as an add-on to the SciChart High Performance WPF Charts library. For more info about the renderer plugins that SciChart provides, please see the articles High Quality vs. High Speed vs. DirectX Renderer Plugins as well as How Fast is SciChart’s DirectX WPF Chart.

Once we move away from the happy, safe world of .NET and into unmanaged code, we need to take a few extra steps to ensure compatibility! This post aims to address compatibility issues with using the Direct3D10RenderSurface, a premium add-on to SciChart High Performance WPF Charts.


Direct3D10RenderSurface System Requirements

Operating System Requirements

The SciChart Direct3D10RenderSurface requires Windows Vista, 7, 8, 8.1 or higher.

Hardware Requirements

The SciChart Direct3D10RenderSurface requires a DirectX10 compatible GPU.

You can check the DirectX version your GPU supports by running the DXDiag.exe application, found under your windows start menu.

Prerequisites

The SciChart Direct3D10Renderer has a dependency on D3DX9_43.dll and D3DX10_43.dll.

D3DX9 and 10 are extensions to DirectX and are not installed with Windows as standard.


Deploying your SciChart Application with the Direct3D10RenderSurface

Developer PCs and End-User PCs have the same system requirements to run the SciChart DirectX Renderer. To ensure your SciChart application can use the Direct3D10RenderSurface wherever available, and downgrade to software renderer when not available, please follow these steps:

1. Enable the DirectX Renderer

Follow the example at Easy Fallback from DirectX to Software Rendering without code behind:

<SciChartSurface DirectXHelper.TryApplyDirectXRenderer="True">

...
</SciChartSurface>
2. Distribute SharpDX 2.6.2 with your Application

The Direct3D10RenderSurface also has a dependency on SharpDX v2.6.3 (a Managed Wrapper for DirectX, licensed under the MIT License).

Please make sure the following DLLs are in your output directory (where your application exe resides) when deploying applications with DirectX. SharpDX is also available on NuGet.

  • SharpDX.D3DCompiler.dll (part of SharpDX v2.6.3)
  • SharpDX.Direct3D9.dll
  • SharpDX.Direct3D10.dll
  • SharpDX.dll
  • SharpDX.DXGI.dll

SharpDX_Dependencies

3. Ensure the DirectX Runtime is installed on End-User PCs

All End-User PCs must have the DirectX Runtime installed. The package is included in the SciChart v3.2.4 or later installation directory at %InstallDir%PrerequisitesDirectX.

You will need to include the DirectX Prerequisites and install DXSetup.exe on end-user PCs when you deploy your application*. To silently install the DirectX Runtime on end-user PC’s, please run the following command line in your application deployment process:

EXEC DXSetup.exe /silent

SciChart DirectX Prerequisites Installer

*Microsoft permits you to redistribute the above files with your end-user applications royalty free. The licensing terms for DXSetup can be found in the licensing agreement of the DirectX End-User Runtimes (June 2010)


Frequently Asked Questions

Q: How can I check at runtime if the DirectX renderer is supported on my PC?

A: You can use the Direct3D10CompatibilityHelper class!

Usage:

/// <summary>
/// A helper class which can be used to detect if the Direct3D10 enhancements to SciChart can run on the current hardware & operating system
/// </summary>
public static class Direct3D10CompatibilityHelper
{
   /// <summary>
   /// Supported operating systems include Windows Vista, Windows 7, Windows 8, 8.1 and up. Windows XP, 2000, 2003 are not supported.
   /// </summary>
   public static bool IsSupportedOperatingSystem { get; }

   /// <summary>
   /// Determines if the DirectX10 Runtime Libraries can be found in the C:WindowsSystem32 and C:WindowsSysWow64 folders. If the libraries are not present, we recommend
   /// installing the DirectX Runtime from %SciChart Install Dir%/Prerequisites/DirectX.
   /// This installs platform specific libraries (x86, x64) and SciChart dynamically chooses the correct DirectX version at runtime
   /// </summary>
   public static bool HasDirectX10RuntimeInstalled { get; }

   /// <summary>
   /// Determines if the current GPU supports DirectX10 or later
   /// </summary>
   public static bool HasDirectX10CapableGpu { get; }

   /// <summary>
   /// Determines if the current hardware & software configuration fully supports DirectX10 or later
   /// </summary>
   public static bool SupportsDirectX10 { get { return IsSupportedOperatingSystem && HasDirectX10RuntimeInstalled && HasDirectX10CapableGpu; } }
}
Q: Do I have to install the DirectX Runtime on every End-User PC?

A: SciChart actually only requires D3DX9_43.dll and D3DX10_43.dll

The way to deploy them is by including DXSetup.exe and related files (found in the %SciChartInstallDir%PrerequisitesDirectX folder) with your application deployment. You can run DXSetup on end-user PCs by calling the command line

EXEC DXSetup.exe /silent

Please note: The licensing terms for the DirectX Runtime restrict you from packaging or embedding the required DLLs with your application, but allows distributing DXSetup and associated files in the %SciChartInstallDir%/Prerequisites/DirectX folder. You must run the DXSetup installer on end-user PCs to remain compliant with Microsofts terms.

Q: Does the DirectX Renderer Work over Remote Desktop?

A: We use D3DImage, which is a Microsoft control that allows sharing of DirectX content with WPF, avoiding airspace issues and allowing fast interop between WPF’s DirectX9 and DirectX10 rendering.

Unfortunately D3DImage has a bug, a nasty one. It won’t work over remote desktop if your application is .NET4.0! It will work over Remote Desktop on .NET4.5 and above.

Since SciChart v4 we have developed a workaround where SciChart DirectX will now work over remote desktop. This is automatic and no changes need to be applied to your code.

Q: I am experiencing flicker with DirectX in my application

Please see this FAQ which talks about how to resolve the problem of Flickering Charts in SciChart.

Q: How much faster is the DirectX Renderer than the Software Renderer?

A: The answer will depend on your exact hardware, software configuration and what you are doing with the chart. In our tests we found the DirectX Renderer to be on average 3.92x faster than the High Speed software renderer, and with superior visual quality (sub-pixel antialiasing).

Not bad for a drop-in upgrade!

 

Got Feedback?

DirectX is a big part of our future, so we want to make this work for you. If you experience compatibility issues or other problems using the DirectX renderer, then please do get in contact with your feedback. We would love to be of assistance.

 

By Andrew Burnett-Thompson | Jan 17, 2017
CEO / Founder of SciChart. Masters (MEng) and PhD in Electronics & Signal Processing.Follow me on LinkedIn for more SciChart content, or twitter at @drandrewbt.

Leave a Reply