Software rendering of 3D datasets

REDsdk is a hybrid graphic engine, suitable for both real-time rendering using OpenGL and software rendering using CPU cores available from the system. We'll discuss software rendering more in depth all along this chapter.

Lights for software rendering

We have seen that we had two categories of lights available in REDsdk:

Both categories of lights can be rendered using GPU accelerated hardware rendering AND software rendering. Some of the physical lights are just approximated when they get rendered by a GPU, and some specific real-time features of lights may be approximated when rendered in software. That being said, real-time lights have been designed for real-time rendering first, and physical lights have been designed so that they can be used for high quality photo-realistic images.

So, for software rendering, the set of lights we'll focus on should preferably be made of:

An example of IES profile information from a lamp manufacturer website.

All physical lights have an emitting surface: it can be any mesh (case of the physical light) or the sun (seen as a bright disc from earth) or the sky (light coming from the entire hemisphere). Consequently, lighting and shadowing will be based on a sampling solution to calculate an estimation of the lighting received at a point. REDsdk's sampling method uses a performance / quality parameter: this is the RED::OPTIONS_RAY_LIGHTS_SAMPLING_RATE. Changing the value of this option changes the quality of the lighting and shadowing and of course the rendering time needed to produce the result:

Variation of the sampling quality from 4 (left) 16 (center) to 64 (right). Skylight only.

Using a HDR rendering pipeline

REDsdk's software ray-tracer will always match the output format of the VRL it renders into. Therefore, unless the RED::OPTIONS_WINDOW_HDR option is turned on, or unless the rendering occurs on an auxiliary VRL set with a HDR format (see Choosing a full HDR rendering pipeline) results of the software rendering will be converted to match the VRL internal format.

Because we'll need tonemapping if we do render with physical lights, the VRL used for the processing of the software image should be set in any floating point or half floating point format so that we can capture the intensity of the calculated image.

Enabling tonemapping

This is the next step: after having set physical lights and rendered the scene into a floating point denormalized format, we'll need tonemapping to get back to an image in the visible range. See the chapter dedicated to tonemapping and more generally to image post-processing here: Tone mapping.

Software ray-tracing

Ray-tracing is the heart of REDsdk's software rendering solution. Consequently, it can handle very large models and remain responsive, thanks to the progressive refinement delivered by the renderer. Taking the best out of the software renderer requires an application event loop designed for that purpose. Differences between hardware and software rendering loops are investigated here: Hardware event loop vs. software event loop.

Then, using the ray-tracer is a matter of calling the right rendering method (see Rendering methods), and activating some ray-tracing options to ensure that an image will be processed.

We'll review all this in depth and more here: Ray-tracing

Using global illumination

Global illumination is a key algorithm needed to reach a photo-realistic quality level. Global illumination algorithms are very complex pieces of code, are time consuming techniques, but are a must have for any high quality image. The effect of turning on global illumination is dramatic for any indoor rendering:

No GI solution (left), with a GI solution (right).

GI is in charge of calculating all the light interactions between all entities in a model. Any object that receive an amount of energy absorbs part of this energy and re-emit the remaining part everywhere in space. GI is about calculating these interaction and solving this energy exchange problem and is reviewed here: Global illumination.

Volumetric effects

Volumetric effects are a pure software ray-tracing feature that can be activated in REDsdk. Volumetric effects add a lot of realism to a scene, as illustrated in the image below:

All the details on volumetric effects have been grouped together in the page linked here: Volumetric effects.