NyxRenderer#

class gs_nyx.nyx_py_renderer.NyxRenderer#

Bases: object

GPU rendering bridge. Owns a rendering server and exports its interop buffers to Python.

Constructors

NyxRenderer()

Construct an uninitialized renderer; call ‘startup’ before use.

Methods

allocate_scene_buffers

Allocate the interop buffers needed to drive the scene from Python according to the given BridgeUpdateDesc.

buffer_size

Number of bytes the renderer reads or writes in the given interop buffer.

camera_resolution

(width, height) in pixels of the given camera.

color_output_size

Size in bytes of the packed CameraColor buffer filled by 'render_batch'.

color_slot

(offset, stride) in bytes of the given camera inside the packed color buffer: env 0 starts at 'offset', consecutive envs are 'stride' apart.

device_identity

Identity of the GPU the renderer runs on (DeviceIdentity), to pick the compute device sitting on the same GPU.

export_buffer

Export an interop buffer as an ExportedGraphicsBuffer, or None when the buffer was not allocated (empty category).

external_memory_handle_type

Kind of OS handle 'export_buffer' returns on this graphics API and platform (EExternalMemoryHandleType).

load_scene_from_file

Load a scene file from disk into the renderer.

pick_pixel

Pick the scene object visible under 'pixel' from the given camera.

reload

Reload the currently loaded scene from its file, re-importing only the assets that changed on disk since the last load or reload.

render_batch

Render every (env, camera) pair of the scene into the packed CameraColor buffer and wait for the GPU.

render_frame

Render env 0 from the given camera into the start of the CameraColor buffer, as tightly packed (H, W, 3) uint8 rows with '(width, height) = camera_resolution(camera_index)', and wait for the GPU.

set_debug_view

Select the view visualized when the render mode is ERenderMode.Debug.

set_deform_entity_active_triangles

set_env_map

Select the active environment map by index in the scene's environment map array.

set_render_mode

Select the render mode used by the next rendered frames.

shutdown

Release all renderer and SDK global resources.

startup

Initialize the renderer with the given BridgeStartupParams and load shipped shader/asset resources.

trace_ray

Trace a ray against the scene.

unload_scene

Unload the currently loaded scene and free its GPU resources.

update

Advance per-frame renderer bookkeeping.

update_scene

Signal that the interop buffers hold new data (wait for the compute writes first).