NyxPyRenderer#

class gs_nyx_plugin.nyx_renderer.NyxPyRenderer[source]#

Bases: object

Python-side wrapper around the native Nyx renderer.

Owns the CUDA tensors that bridge Genesis simulation state (rigid transforms, deformable vertex positions, camera poses) to the Nyx GPU renderer, and drives the per-frame upload + render. End users typically interact with the renderer indirectly via NyxCameraSensor; this class is exposed for advanced use cases that need to drive the renderer manually.

Coordinate convention#

Genesis is Z-up, Nyx is Y-up. Static scene data is converted on the CPU at export time by NyxSceneExporter; per-frame transforms are uploaded as raw Genesis-space (Z-up, WXYZ) values and converted on the GPU.

Lifecycle#

  1. Construct with the scene, exported scene-description path, and max viewport size.

  2. Call build() once after the Genesis scene has been built, passing the entity-to-UUID mapping from NyxSceneExporter. This starts the renderer, loads the scene, and allocates GPU buffers sized to the current geometry counts.

  3. Each frame: update_scene() for each environment, then render() per camera. update() once per frame drives the window event loop and animation clock.

  4. destroy() releases the native renderer and GPU buffers.

Constructors

Methods

build

Start the native renderer and allocate all GPU buffers.

destroy

Shut down the native renderer and release the interop buffers.

pick_pixel

Cast a ray through one pixel and return the entity and hit point.

render

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

unload_scene

Release the loaded scene without shutting down the renderer.

update

Drive the native renderer's per-frame tick (window + animation clock).

update_camera_tensor

Write one camera's pos + quaternion directly into the CUDA tensors.

update_scene

Sync one Genesis environment's state to the Nyx GPU buffers.