Iray Programmer's Manual

Rendering overview

The neuray rendering system supports GPU rendering on qualified hardware as well as software rendering using MDL materials. The available Iray render modes are Iray Photoreal, Iray Interactive, Iray Photoreal, and Iray Blend.

You can render from different application threads at the same time using the same or a different render mode and the same or different scenes or even different versions of the same scene at the same time.

To render an image you start with a render context that you obtain from the method mi::neuraylib::IScene::create_render_context() of an neuray Scene object. The neuray Scene object is a normal scene database element that you create and edit through a transaction. You initialize the scene by setting the rootgroup, the camera instance, and the render options of the Scene object.

You can use the render context to render multiple frames. The rendered pixels will be written to a render target object, which is an implementation of an abstract C++ interface class. You can provide your application specific implementation of this interface class and pass it as a pointer to one of the render functions of the render context. This concept allows you for example to render to files, to render directly to the screen, or to render to textures. It also allows you to do progressive rendering. An example for a render target implementation is provided with the neuray release.

The render context is bound to one scene. You can use a render context to render from a single thread. The render call will return after the full image has been rendered or after rendering has been aborted. You can abort a rendering operation from a different thread using the render context object. However, aborting might not necessarily be instantaneous.

Progress Reports

To obtain information on how a rendering is progressing, you can pass a progress object to a render call. A progress object implements an abstract C++ interface class which has only one method which is used by the neuray system to signal progress. This method can be called from any thread in the neuray system including the thread which initiated the render call. It will get a string which describes the rendering phase, and a number between 0 and 1 which specifies how much progress has been made in this phase.