Iray Programmer's Manual

Client integration

The Iray Bridge client-side features are made available by loading the plugin iray_bridge_client.dll/so. This plugin will make the Iray Bridge render modes available and install the API component:

mi::bridge::IIray_bridge_client

The only configuration needed is the web socket URL to the Iray Bridge application and, optionally, a security token if the Iray Bridge application on the server is set up to require that. In that case, the server application will inspect the security token and can reject the connection if it was not correct.

The application address is set by looking up the API component mi::bridge::IIray_bridge_client and calling:

mi::bridge::IIray_bridge_client::set_application_url(const char* url)

The URL is a web socket URL and both plain and secure web sockets are supported, for example ws://some.host/some_app or wss://some_host/some_app.

The optional security token is set by calling:

mi::bridge::IIray_bridge_client::set_security_token(const char* token)

These two methods set the default values that will be used by all the Iray Bridge render contexts when a connection to the Iray Bridge server needs to be established. The values can be changed at any time which will cause any active Iray Bridge render contexts to reconnect using the new values on the next rendered frame. It is also possible to override the Bridge application address and security token per Iray Bridge render context by setting the render context options bridge_address and bridge_security_token.

The Iray Bridge API component also allows creation of a snapshot context which works analogous to render contexts but can be used to save a very efficient snapshot of a scene on the server. The snapshot can later be imported off-line on the server, just like a regular scene, to provide features like batch rendering. The snapshot contexts also use the default Iray Bridge application address and security token configured on the IIray_bridge_client API component and can also be overridden per snapshot context by setting the options bridge_address and bridge_security_token.

Iray Bridge can use hardware decoded H.264 for streaming images from the server. This feature is provided by loading the nvcuvid_video_decoder.dll/so plugin on the client. This plugin provides hardware H.264 decoding on NVIDIA GPUs that supports this. Note that the maximum resolution that is supported varies depending on the capabilities of the GPU. A software H.264 decoder fall-back can be provided by loading the ffmpeg_video_decoder.dll/so. The software decoder will automatically be used if the NVIDIA hardware decoder fails, for instance because no suitable NVIDIA GPU is installed, or because the resolution is too high.

Alternatively, Iray Bridge can also use any image format supported by Iray for streaming images from the server. Loading the freeimage.dll/so plugin provides a large number of image formats that suits different needs and have different size/quality trade-offs such as jpg, png, or exr. Loading other image plugins will automatically make the format available for use by Iray Bridge.