Concepts#
Note
This page is a stub. Flesh it out as the API stabilises. The intent is to give a one-page mental model that bridges the Quickstart and the API reference.
The renderer lifecycle#
A NyxRenderer instance progresses through three states:
Constructed, Python object exists, no GPU resources allocated.
Started, the Nyx SDK has been booted with a
BridgeStartupParams; a GPU has been picked (by memory size, or by vendor / adapter index through itspickStrategy), and the Vulkan context, swapchain, and asset pools are live. The plugin registers the SDK’s start hook with Genesis at import time, sogs.init()triggers this transition for you.Shut down, all GPU resources have been released and the instance is no longer usable.
gs.destroy()(or interpreter teardown) triggers this transition through the same registered stop hook.
Scenes and assets#
A scene is the renderer’s view of “what exists”. It is composed of typed assets:
Asset class |
Role |
|---|---|
Container that owns the rest |
|
One placed mesh, with a transform and a material binding |
|
A virtual camera with a pose, a resolution and a reference to a camera profile |
|
The physical camera model: lens, sensor and colour management (see Camera profiles) |
|
A point / directional / spot / area light |
|
Shader parameters and texture references |
|
A captured radiance field (Gaussian splat or sparse grid) |
|
Image-based lighting |
Each asset has a stable UUID. The plugin serialises the scene to JSON once, at scene.build(), and the renderer loads it from disk.
Driving the scene from Python#
Per-frame state does not go through the asset model. The renderer is told which buffers to allocate through a BridgeUpdateDesc (how many rigid geometries, cameras, deformable vertices and triangles, and how many environments), and it then exports those buffers (EBridgeBuffer) as OS handles. The plugin imports them into PyTorch with NyxExternalMemoryImporter, so writing a new transform or a new vertex position is a plain tensor copy into memory the renderer owns. This is what makes the plugin independent of the compute API: the same code runs on a CUDA torch build and on a ROCm torch build (see GPU backends: CUDA and ROCm).
The rendered images come back the same way: the packed colour output is one more exported buffer, and cam.read().rgb is a view into it.
Render modes#
ERenderMode selects the rendering algorithm:
Forward, rasterisation. Fastest. Suited for visualisation and RL rollouts.FastPathTracer, biased path tracer. Photorealistic with manageable cost.RefPathTracer, reference unbiased path tracer. Slow but ground-truth.Debug, visualise normals, depths, materials, etc. (seeEDebugView).
Integrating with Genesis#
The plugin is designed to ingest scene state from a Scene, translate it into Nyx assets, and produce rendered frames that can be returned to Genesis as observations.
See Attaching a camera for the end-to-end pattern.