Knowledgebase
High Quality vs. High Speed vs. DirectX Renderer Plugins
Posted by Andrew BT on 11 February 2019 02:07 PM

The documentation article about all renderer types available in SciChart can be found at this link. The example that demonstrates differences between different renderer types can be found in SciChart WPF Examples Suite  Styling and Theming -> Use High Quality Rendering. The full source code of the example is available online at this link.

The SciChart Renderer Plugins

SciChart ships with three rasterizer plugins which use different algorithms to render the RenderableSeries to the screen. These are:

  • The HighSpeedRenderSurface
    An integer coordinate, fast, software renderer (CPU Based). Produces jagged lines but it's very quick. 

  • The HighQualityRenderSurface (Available in the Pro and Source Editions)
    A floating point coordinate software renderer (CPU Based). Produces the best quality image, but uses more CPU resources than HighSpeed.

  • The Direct3D11RenderSurface (Available in the Source Edition)
    A floating point, DirectX11 hardware renderer (GPU Based). Utilizes pixel shaders to offload as much computation to the GPU as possible.

    The DirectX Renderer produces anti-aliased quality lines and is significantly faster in cases where you have a large monitor, many series, or noisy series. Full test-results can be seen at the article How Fast is SciChart's WPF Chart.

    Requires a DirectX11 (Recommended) or DirectX10 compatible hardware and Windows Vista, 7, 8, 8.1 or later to operate.
  • The XamlRenderSurface (Available in the Source Edition)
    A vector software renderer (CPU Based). Produces vector images, but is the most CPU-expensive among the other renderers. Can be used to generate high-quality vector images. To learn more about this renderer type, please see the "Is SciChart DPI-aware?" article and our documentation.

Take a look at the screenshots below to compare the visual output of the three rasterizer plugins:

High Speed vs High Quality vs DirectX RendererHigh Speed vs High Quality vs DirectX RendererHigh Speed vs High Quality vs DirectX RendererHigh Speed vs High Quality vs DirectX RendererHigh Speed vs High Quality vs DirectX RendererHigh Speed vs High Quality vs DirectX Renderer

You can also compare the difference between the SciChart renderer plugins using our WPF Chart Examples Suite, Use High Quality Rendering Example.


Enabling the HighSpeedRenderSurface

By default, SciChart uses the HighSpeedRenderSurface. This is available in all editions of SciChart.

This has very a fast set of integer-coordinate line drawing algorithms, drawn to a bitmap, which are quick, but won't give you the pixel-perfect accuracy you might expect from WPF applications. Use this renderer if speed is paramount to you and you can sacrifice a little bit of quality. 

To enable the HighSpeedRenderSurface  (enabled by default), use this code:

<s:SciChartSurface>
   <s:SciChartSurface.RenderSurface>
      <s:HighSpeedRenderSurface/>
   </s:SciChartSurface.RenderSurface>
</s:SciChartSurface>

Enabling the HighQualityRenderSurface

The HighQualityRenderSurface is available in SciChart WPF & Silverlight Professional and Source-Code Editions.

An alternative renderer which you must enable if you wish to use it, is the HighQualityRenderSurface. This has an extremely accurate, sub-pixel floating point rendering engine which yields results of very high quality. It is slower than the HighSpeedRenderSurface  and should be used if quality is more important than speed. 

To enable the HighQualityRenderSurface, use this code:

<s:SciChartSurface>
   <s:SciChartSurface.RenderSurface>
      <s:HighQualityRenderSurface/>
   </s:SciChartSurface.RenderSurface>
</s:SciChartSurface>

Enabling the Direct3D11RenderSurface

The Direct3D11RenderSurface is available for SciChart Source-Code Edition.

This is a DirectX11 implementation of the RenderSurface which is able to provide the quality of HighQualityRenderSurface with speed comparable to or faster than the HighSpeedRenderSurface. Requires DirectX11 (Recommended) or DirectX10 compatible hardware, WPF4 and Windows Vista or up.

Enabling the Direct3D10RenderSurface

To enable the Direct3D11RenderSurface, please use this code

XAML

<!-- Where s3D XML namespace is defined as -->
<!-- xmlns:s3D="http://schemas.abtsoftware.co.uk/scichart3D" -->
<!-- You will also need a reference to Abt.Controls.SciChart3D.Wpf.dll -->
<s:SciChartSurface.RenderSurface>
    <s3D:Direct3D11RenderSurface InitializationFailed="OnDirectXInitializationFailed" 
                                 RenderingFailed="OnDirectXRenderingFailed"/>
</s:SciChartSurface.RenderSurface>

Code Behind

The DirectX Renderer is able to detect hardware failures and downgrade to software rendering. To enable this, please subscribe to the InitializationFailed and RenderingFailed events and handle them:

private void OnDirectXInitializationFailed(object sender, DXErrorEventArgs e)
{
    MessageBox.Show("DirectX Initialization Failed. "
                 + "Downgrading to Software. See inner exception for details: "
                 + e.Exception.Message);
    this.sciChart.RenderSurface = new HighSpeedRenderSurface();
}

private void OnDirectXRenderingFailed(object sender, DXErrorEventArgs e)
{
    MessageBox.Show("DirectX Initialization Failed. "
                 + "Downgrading to Software. See inner exception for details: "
                 + e.Exception.Message);
    this.sciChart.RenderSurface = new HighSpeedRenderSurface();
}

Enabling the DirectX Renderer Plugin with Easy Fallback to Software Rendering

See also this article Easy Fallback from DirectX to Software Rendering without code-behind which presents a nice easy way to fall-back to software rendering (from DirectX) via a single attached property.


Deploying Applications with the Direct3D11RenderSurface

See our article on Creating and Deploying Applications with the Direct3D11RenderSurface for deployment instructions.


Tell Us Your Feedback!

Tell us your feedback! Which renderer do you use and why? In our tests DirectX outperforms software renderers by >400% in some cases. What's it like on your machine? Is there something we can improve? 

 

 

 

(4 vote(s))
Helpful
Not helpful

Comments (0)

CONTACT US

Not sure where to start? Contact us, we are happy to help!


CONTACT US

SciChart Ltd, 16 Beaufort Court, Admirals Way, Docklands, London, E14 9XL. Email: Legal Company Number: 07430048, VAT Number: 101957725