isaaclab.renderers#
Sub-package for renderer configurations and implementations.
This sub-package contains configuration classes and implementations for different renderer backends that can be used with Isaac Lab.
Classes
Abstract base class for renderer implementations. |
|
Configuration for a renderer. |
Base Renderer#
- class isaaclab.renderers.BaseRenderer[source]#
Bases:
ABCAbstract base class for renderer implementations.
Methods:
Post-physics one-time initialization hook.
prepare_cameras(stage, spec)Pre-render per-camera setup the backend needs.
Per-output layout (channels + dtype) this renderer can produce.
prepare_stage(stage, num_envs)Prepare the stage for rendering before
create_render_data()is called.create_render_data(spec)Create render data for the given camera
CameraRenderSpec.set_outputs(render_data, output_data)Store reference to output buffers for writing during render.
Update scene transforms before rendering.
Update mutable geometry attributes before rendering.
update_camera(render_data, positions, ...)Update camera poses and intrinsics for the next render.
render(render_data)Perform rendering and write to output buffers.
read_output(render_data, camera_data)Read rendered outputs from the renderer into the camera data container.
cleanup(render_data)Release renderer resources associated with the given render data.
close()Release resources owned by the renderer itself rather than by a render data.
Attributes:
Return the backend's shared material-writer factory, if supported.
- property visual_material_writer: Callable[[tuple[VisualMaterialBatch, ...]], Any] | None#
Return the backend’s shared material-writer factory, if supported.
Its writer accepts
Nonefor a full sync or channel-to-material-offset device arrays plus one environment-id device array for partial writes, and provides an idempotentclose().
- prepare_cameras(stage: Any, spec: CameraRenderSpec) None[source]#
Pre-render per-camera setup the backend needs.
The default implementation is a no-op. Renderer subclasses override to perform whatever per-camera initialization their backend requires — e.g. authoring stage attributes on the resolved camera prims, configuring per-tile GPU buffers, or any other state setup.
- abstractmethod supported_output_types() dict[RenderBufferKind, RenderBufferSpec][source]#
Per-output layout (channels + dtype) this renderer can produce.
Outputs absent from the mapping are not produced by this backend.
- Returns:
Mapping from supported
RenderBufferKindto itsRenderBufferSpec.
- abstractmethod prepare_stage(stage: Any, num_envs: int) None[source]#
Prepare the stage for rendering before
create_render_data()is called.Some renderers need to export or preprocess the USD stage before creating render data. This method is called after the renderer is instantiated and before
create_render_data().
- abstractmethod create_render_data(spec: CameraRenderSpec) Any[source]#
Create render data for the given camera
CameraRenderSpec.- Parameters:
spec¶ – Immutable description of the tiled camera (paths, config, device).
- Returns:
Renderer-specific data for subsequent
render()/read_output()calls.
- abstractmethod set_outputs(render_data: Any, output_data: dict[str, ProxyArray]) None[source]#
Store reference to output buffers for writing during render.
- Parameters:
render_data¶ – The render data object from
create_render_data().output_data¶ – Dictionary mapping output names (e.g.
"rgb","depth") to pre-allocatedProxyArraywrappers where rendered data will be written. Use.warpfor the underlying warp array or.torchfor a zero-copy tensor view.
- abstractmethod update_transforms() None[source]#
Update scene transforms before rendering.
Called to sync physics/asset pose state into the renderer’s scene representation.
- abstractmethod update_geometries() None[source]#
Update mutable geometry attributes before rendering.
Called to sync physics-driven geometry such as mesh points, extents, or other per-frame geometry buffers into the renderer’s scene representation.
- abstractmethod update_camera(render_data: Any, positions: ProxyArray, orientations: ProxyArray, intrinsics: ProxyArray) None[source]#
Update camera poses and intrinsics for the next render.
- Parameters:
render_data¶ – The render data object from
create_render_data().positions¶ – Camera positions in world frame. Shape
(N,), dtypewp.vec3f. Use.torchfor a(N, 3)tensor view.orientations¶ – Camera orientations as quaternions
(x, y, z, w). Shape(N,), dtypewp.quatf. Use.torchfor a(N, 4)tensor view.intrinsics¶ – Camera intrinsic matrices. Shape
(N,), dtypewp.mat33f. Use.torchfor a(N, 3, 3)tensor view.
- abstractmethod render(render_data: Any) None[source]#
Perform rendering and write to output buffers.
- Parameters:
render_data¶ – The render data object from
create_render_data().
- abstractmethod read_output(render_data: Any, camera_data: CameraData) None[source]#
Read rendered outputs from the renderer into the camera data container.
- Parameters:
render_data¶ – The render data object from
create_render_data().camera_data¶ – The
CameraDatainstance to populate.
- abstractmethod cleanup(render_data: Any) None[source]#
Release renderer resources associated with the given render data.
- Parameters:
render_data¶ – The render data object to clean up, or
None.
- close() None[source]#
Release resources owned by the renderer itself rather than by a render data.
A renderer is shared by every camera whose configuration resolves to it (see
get_renderer()), so state it owns outlives any single camera and cannot be released fromcleanup().close()calls this once at simulation teardown, while the stage and the underlying renderer backend are still alive.The default implementation is a no-op, for backends whose state lives entirely on the render data. Implementations must be idempotent.
Renderer Configuration#
Additional Public Classes#
The following classes are part of the public isaaclab.renderers API.
Stable inputs for |
|
Canonical names for the per-pixel render buffer kinds a renderer can publish. |
|
Per-pixel layout (channels + dtype) for one render buffer kind. |
|
Own camera renderers and flat runtime material buffers for one simulation. |
- class isaaclab.renderers.CameraRenderSpec[source]#
Bases:
objectStable inputs for
create_render_data().Backends use this instead of holding a reference to the
Camerasensor instance, avoiding circular dependencies between sensors and render data.- Parameters:
cfg¶ – Camera configuration (data types, resolution, filters, etc.).
device¶ – Torch device string (e.g.
"cuda:0") used by GPU annotators and Warp.num_instances¶ – Number of tiled camera instances (environments).
camera_prim_paths¶ – Absolute USD paths for each environment’s camera prim.
view_count¶ – Number of camera prims (must match
len(camera_prim_paths)).camera_path_relative_to_env_0¶ – Camera prim path with
/World/envs/env_0/prefix stripped; required by OVRTX. Empty string if the first camera is not under env 0.
Methods:
- classmethod __new__(*args, **kwargs)#
- class isaaclab.renderers.RenderBufferKind[source]#
Bases:
StrEnumCanonical names for the per-pixel render buffer kinds a renderer can publish.
String values match the vocabulary used by
isaaclab.sensors.camera.CameraCfg.data_types.Methods:
- __new__(value)#
- __init__(*args, **kwds)#
- class isaaclab.renderers.RenderBufferSpec[source]#
Bases:
objectPer-pixel layout (channels + dtype) for one render buffer kind.
Methods:
- classmethod __new__(*args, **kwargs)#
- class isaaclab.renderers.RenderContext[source]#
Bases:
objectOwn camera renderers and flat runtime material buffers for one simulation.
A camera reuses a backend when a prior camera registered a config equal under
==(value equality) and the same concreteRendererCfgsubclass. A distinctRendererCfgthat maps to a different implementation (e.g. Isaac RTX vs Newton) produces another backend; each hasBaseRenderer.prepare_stage()run before use.update_scene_state()is invoked at most once perget_physics_step_count()for the context;Methods:
- classmethod __new__(*args, **kwargs)#