RealityServer Features

Progressive Rendering

Progressive rendering is directly supported in the handler (since improving progressive rendering performance is the main driver for render loops). When using 'interactive' scheduling mode the handler can be used with no special configuration. This will provide fast feedback to the user and increasingly efficient rendering as the image converges. It is also possible to use 'batch' scheduling for cases where fast user feedback is not so important, however in this case you need to control the update interval through the handler itself to ensure fast updates when changes occur.

Batch scheduling

Batch scheduling is enabled by setting the scheduler_mode render context option to batch. You would also usually set the batch_update_interval render context option to control how often a new render is returned and made available to the user (for example: 3 seconds).

However if changes are made to the scene this would mean that the first render containing the changes would take 3 seconds to return. To counter this the render handler takes over control of the batch_update_interval option itself. When changes are made to the scene, or if a render is cancelled, it automatically sets batch_update_interval to 1/3 second to ensure fast updates when editing. After that render it sets it back to the value of the update_interval handler parameter.

In summary, when using the batch scheduling mode you need to control the batch_update_interval option via the update_interval render handler paramter rather than use the render context option directly.

This feature can be disabled by setting the control_update_interval parameter to off. In this case the batch_update_interval should be set via the usual render context option. Note that if you disable after starting the render loop you should also set the render context option as it will retain the current value as set by the handler.

Batch Update Interval Handler Properties
Property Key Default Description
control_update_interval "on" Whether to control the update interval (in batch mode) to allow interactivity.
update_interval "3" The number of seconds to render each image for before returning (in batch mode).

Example: Sets up batch scheduler mode and updates the image every 2 seconds.

{
    "method": "render_loop_start",
    "params": {
        "render_loop_name": "my_render_loop",
        "scene_name": "my_scene",
        "timeout": 60,
        "render_loop_handler_name": "default",
        "render_context_options" : { "scheduler_mode": { "value": "batch", "type": "String" } },
        "render_loop_handler_parameters": [ "renderer", "iray", "update_interval", "2" ]
    }
}

Multiuser efficency

In both interactive and batch modes Iray will spend more time rendering per render call as the image refines (well beyond any update interval set). For example once an image reaches a few thousand samples each render call can perform multiple hundreds of samples to provide greater efficiency and more refinement per call.

With only a single user this is not problematic. However if multiple users are accessing a single RealityServer instance this can cause problems as renders at low sample counts (EG: users who are moving the camera) get locked out of the GPUs as other users execuate long render calls.

This problem can be mitigated using the max_samples_per_render render handler parameter. When set to a value greater than 0 each render call will perform no more than the given number of samples per call (more or less, iray is not particularly strict about the limit). This will cause renders at high sample counts to return sooner than they normally would, and allow other users access to GPUs.

Similar to the batch scheduling update interval this functionality is implemented by taking over the progressive_rendering_max_samples scene option. Consequently the render handler also exposes a progressive_rendering_max_samples handler parameter to allow the user to still control sample based termination.

Multiuser Efficency Handler Properties
Property Key Default Description
max_samples_per_render "0" The maximum number of samples to render per render call. The value of 0 disables the feature.
progressive_rendering_max_samples none If set then this specifies the sample based convergence criteria (rather than using the options block value). If not set then the value from the scene options is used.

Example: Each render call will perform no more than 100 samples, renders will be considered converved after 10000 samples.

{
    "method": "render_loop_start",
    "params": {
        "render_loop_name": "my_render_loop",
        "scene_name": "my_scene",
        "timeout": 60,
        "render_loop_handler_name": "default",
        "render_loop_handler_parameters": [ "max_samples_per_render", "100", "progressive_rendering_max_samples": "10000" ]
    }
}