Iray Programmer's Manual

Snapshots

Apart from minimizing network traffic, Iray Bridge also uses the server-side disk cache to enable very cheap snapshots of the scene in its current state to be saved on the Iray Bridge server. The scene is saved as a .cb file and contains only hashes of the data. The data itself is stored in the disk cache and can be loaded by using the cb_importer plugin, just like any other scene format. The format is binary and .cb files are only loadable by the same Iray Bridge version that saved them. This feature can be used for example, to efficiently transfer scene data to a server using Iray Bridge, store snapshots of the scene on the server, and then use the snapshots to perform off-line batch rendering.

Snapshots are created on the Iray Bridge server by the client calling the method create_remote_snapshot() of the mi::neuraylib::IRemote_client API component. The snapshot is saved to a folder on the server that is configured by the server calling the method set_scene_export_path() on the mi::neuraylib::IRemote_configuration API component. To load the resulting .cb file, make sure the cb_importer importer plugin is loaded and then import it like any other scene format. Make sure the correct disk cache path is configured. If all data is no longer in the disk cache, the import will fail. See the Iray API documentation for more information.

Saving a snapshot of a scene will replicate the scene data in memory on the server. When the data is no longer needed call the method remove_scene() of the mi::neuraylib::IRemote_client API component. Note that this resets all book-keeping regarding incremental changes for the scene, but it does not remove data from the disk cache on the server. Also note that the data might take some time to unload on the server if it is in use.