Industrial Data Science
in C# and .NET:
Simple. Fast. Reliable.
 
 

ILNumerics - Technical Computing

Modern High Performance Tools for Technical

Computing and Visualization in Industry and Science

tgt

Renderer Types

ILNumerics currently provides three renderer types: GDI, SVG and OpenGL. The ILNumerics.Drawing.Panel control (Windows.Forms) allows you to chose between GDI and OpenGL.

By default, Panel is configured to use OpenGL as preferred driver. If OpenGL is not available, it falls back to GDI.

Panel.RendererType allows one to select the driver manually:

This setting should be made early in the program. At best, before any other configuration / scene setup is done.

SVG is not supported for Panel, since SVG drivers do not have interactive capabilities. This format is used for exporting static scenes.

GDI+ drivers support all features of hardware accelerated drivers (OpenGL). They implement Z buffering for hidden line removal and are capable of handling light (vertex lighting only). The only prerequisite required is System.Drawing. However, be prepared that GDI drivers may require a bit longer rendering times due to the lack of hardware acceleration. 

Stability and Fallback

Panel is designed to serve as reliable and robust interactive panel. By default, it utilizes OpenGL hardware acceleration. However, since not all machines are able to support recent enough versions of OpenGL, an automatic fallback to rendering by GDI is active. Currently, OpenGL 3.1 is required.

In order to stabilize the rendering experience, ILNumerics recognized common pitfalls with OpenGL rendering:

  • Buggy OpenGL drivers; drivers which claim to support OpenGL version 3.1 but failing to create a valid context or to render certain OpenGL 3.1 features.
  • Remote Desktop Transmissions; Some drivers do only support very elementary OpenGL versions (like 1.1) when utilizing a remote desktop connection.

As soon as an OpenGL rendering failure has beed detected, ILNumericcs initiates multiple recovering steps. If failure repeats, GDI driver based rendering is used instead. However, there might be situations, where such failures are silent and not recognizable by ILNumerics.

Such situations will usually cause artefacts or missing elements in the ILNumerics rendering output. If you encounter such problems, you can apply the following fix manually. The Setting switch instructs Panel to utilize an alternative rendering method in affected situations and should be applied either by code or by using the app.config:

 

Driver Feature Matrix

Feature GDI OpenGL SVG WebGL1
3D Rendering + + + +
Transparency + + + +
User Clipping + + + +
Lighting Vertex Fragment Primitive Fragment
MaxNrLights unlimited unlimited unlimited unlimited
Hidden Objects Removal Z-Buffer in ILNumerics Depth Buffer in OpenGL BSP Tree, Painters Depth Buffer, WebGL
Antialiasing partial/optional  optional Always2 optional
[1] driver development in progress; [2] all SVG renderer render primitives strictly antialiased

Example for offscreen rendering are found on Scott Hanselmanns blog.