render#

NyxPyRenderer.render(camera_index=0)[source]#

Render one camera and return the resulting RGB image as a CUDA tensor.

Synchronizes the CUDA stream first so any pending Genesis kernel work on the input tensors has completed before the renderer reads them; without this the renderer can race with the simulation and sample stale geometry.

Parameters:

camera_index (int, optional) – Index into the registered camera list (matches the order in which NyxCameraSensor instances were built, or the Genesis visualizer’s non-debug camera order when no sensors are registered). Default 0.

Returns:

torch.Tensoruint8 image of shape (H, W, 3) on the CUDA device, where (H, W) matches the camera’s configured resolution. The buffer is owned by the renderer — copy it if you need to keep the data past the next render() call.