neuray Services API Programmer's Manual

Render Loops

[neuray Services API]

Description

Render loops allow for maximum resource utilization by performing rendering in a tight loop rather than on demand by the user. This allows for much faster progressive rendering convergence.

These interfaces are used in commands which wish to use render loops and by users who wish to implement their own render loop handlers.

Architecture

The render loop system consists of 3 layers.

  • Manager

The render loop manager, mi::nservices::IRender_loop_manager, is the main interface into render loops. Here render loops can be created and shutdown as well as render loop handlers registered with the system.

  • Render Loops

mi::nservices::IRender_loop represents an actual render loop. These are identified by name and created by the manager. After creation they need to be initialized, have initial handler specific parameters/render context options set and are then started. A new thread is created which then proceeds to render continuously. Other command can then access the render loop by name (again through the manager) to retrieve images, modify parameters or stop rendering.

  • Render Loop Handlers

Render loop handlers perform the actual rendering work. These can be user implemented or one of the built in handlers (default or falsecolor) can be used. Most calls on mi::nservices::IRender_loop are passed directly to the associated handler. To provide a custom handler users must implement mi::nservices::IRender_loop_handler then register its factory class via mi::nservices::IRender_loop_manager::register_render_loop_handler.

Usage

neuray Services ships with a complete set of commands that cover all render loop functionality. Users can simply call these to make use of render loops.

The complete source code to the default render handler is supplied as a reference for those who wish to implement their own render loop handlers.

Classes

class 
Abstract interface called when command execution on a render loop has completed. More...
class 
Abstract interface called when a pick operation on a render loop has completed. More...
class 
This interface represents a single object hit by a pick operation and is an extension of neuraylib::IPick_result that may be used by some render context implementations. More...
class 
Abstract interface called when progress has been made during command execution. More...
class 
Represents a render loop. More...
class 
Defines a render loop handler. More...
class 
Factory class for creating render loop handlers. More...
class 
A user implemented interface that returns the result of an individual render call in a render loop handler. More...
class 
Management class for render loops. More...
class 
Abstract interface to report when the render loop has reached a specific counter. More...
class 
Abstract interface called whenever a render loop renders a canvas. More...

Enumerations

enum mi::nservices::Render_loop_pause_state{ RENDER_LOOP_RUNNING = 0, RENDER_LOOP_PAUSING = 1, RENDER_LOOP_PAUSED = 2, RENDER_LOOP_PAUSE_STATE_FORCE_32_BITRENDER_LOOP_PAUSE_STATE_FORCE_32_BIT = 0xffffffffU}
Render loop pause state.

Enums

enum mi::nservices::Render_loop_pause_state

Render loop pause state.

Enumerator:

RENDER_LOOP_RUNNING = 0
The render loop is currently running.
RENDER_LOOP_PAUSING = 1
The render loop has been flagged to pause and may still be rendering.
RENDER_LOOP_PAUSED = 2
The render loop has paused and no more rendering will occur.
RENDER_LOOP_PAUSE_STATE_FORCE_32_BITRENDER_LOOP_PAUSE_STATE_FORCE_32_BIT = 0xffffffffU