Knowledgebase
High Quality vs. High Speed vs. DirectX Renderer Plugins
Posted by Andrew BT on 03 March 2015 10:13 AM

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 Direct3D10RenderSurface (Available in the Source Edition)
    A floating point, DirectX10 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 DirectX10 Video Card and Windows Vista, 7, 8, 8.1 or later to operate.

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 Direct3D10RenderSurface

The Direct3D10RenderSurface is available for SciChart Source-Code Edition.

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

Enabling the Direct3D10RenderSurface

To enable the Direct3D10RenderSurface, 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:Direct3D10RenderSurface 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 Direct3D10RenderSurface

See our article on Creating and Deploying Applications with the Direct3D10RenderSurface 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? 

 

 

 

(2 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