Rendering Data - Engines And Output

Rendering Engines

There are many ways to render 3-D graphics on a computer. The 3-D capabilities in SwiftVis were written in such a way to allow multiple different libraries to be used. The Render Engine tab allows you to select which engine you wish to use and change any settings associated with that engine. Currently SwiftVis supports three engines, two or which will work with any Java install and do all of their work on the CPU. The third engine uses a graphics card and OpenGL libraries to do the rendering.

CPU-Polygon Method

This engine has been written in Java to transform objects from 3-D into 2-D so that they can be rendered with the Java2D library. Settings in the CPU engine allow you to alter how many polygons are used in the spheres and how wide a camera angle to use. The time it takes to draw a scene scales with the number of polygons. For small scenes, this engine will refresh quite quickly. Using low polygon count spheres (diamonds with 8 triangles), this engine will render a fairly large number of data points quite efficiently.

Ray-Tracing Method

The second rendering engine that comes with a standard SwiftVis install is a ray tracer. The ray tracer will provide much higher quality output, but it is significantly slower. The time it takes the ray tracer to work scales with the size of the image and in odd ways with the number of polygons/spheres in the scene. For scenes with only a few elements, the ray tracer will be much slower than other engines. For scenes with many elements, the relative performance of the ray tracer improves though only because other engines will slow more than it does. Using the ray tracing engine, spheres are geometric spheres, not collections of triangles.

The ray tracing engine includes a number of different options that impact the quality of the image that is produced. This figure was made with the default values. By default that ray tracer casts a single ray for each pixel. That can lead to aliasing. One of the engine options is to throw multiple rays per pixel. This can produce much more natural looking results, but note that render times will scale linearly with the number of rays cast. One can also set the maximum number of recursions for rays bouncing during reflection or scattered rays to pick up indirect lighting. Scattered rays add a lot of time to a rendering and probably shouldn't be used unless you really want that effect. Like the polygon engine, the view size can be set to alter whether the camera has a wider of narrower field of view. It is worth noting that the ray tracer is parallelized so if you have a machine with multiple cores, adjusting the number of threads that SwiftVis uses in the Options menu can significantly improve the rendering speed.

JOGL (OpenGL) Method

The third rendering engine that comes with a standard SwiftVis install is a GPU-based OpenGL engine. While it does not look as nice as the ray tracer provided, it can be used to quickly and easily example a scene and set it up to your liking before rendering. It should be somewhat faster than the CPU-based rendering engine, and certainly faster than the ray tracer, without much quality loss over the CPU engine. Note that you will need to have the JOGL libraries installed for it to work properly - JOGL can be downloaded at https://jogl.dev.java.net/ and installation instructions can be located there as well.

Render Output

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License