base
Abstract interface for a pluggable render backend.
The Simulator constructs exactly one RenderBackend instance (exposed as og.sim.render_backend), chosen via gm.RENDER_BACKEND. This is the sibling abstraction to physics_backends.PhysicsBackend.
The interface covers application and Simulator-setup lifecycle, the render-graph "tick" primitive, and camera/modality capture. Viewport/GUI management and material authoring are still only partly relocated here; the remaining Kit-specific call sites are being moved behind this interface incrementally.
RenderBackend
Bases: ABC
Abstract base class for a render backend.
Source code in OmniGibson/omnigibson/render_backends/base.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
add_reference_to_stage(asset_path, prim_path)
abstractmethod
References the USD at @asset_path in at @prim_path.
Returns:
| Type | Description |
|---|---|
Prim
|
The referencing prim. |
add_semantic_labels(prim, label, instance_name='class')
abstractmethod
Tags @prim with semantic @label under @instance_name, for segmentation rendering.
apply_renderer_settings()
attach_modality(annotator, camera_resource)
abstractmethod
Attaches @annotator (from create_annotator) to @camera_resource so it starts collecting data.
before_play(sim)
compute_world_aabb(prim_path)
abstractmethod
Returns:
| Type | Description |
|---|---|
2 - tuple
|
(aabb_min, aabb_max) world-frame axis-aligned bounds of @prim_path, each a 3-tuple of floats. |
copy_mesh_prim(source_prim_path, dest_prim_path)
abstractmethod
Copies the single, childless Mesh prim at @source_prim_path to @dest_prim_path. Narrower than copy_prim(); the caller guarantees there is no subtree to carry along.
Source code in OmniGibson/omnigibson/render_backends/base.py
copy_prim(source_prim_path, dest_prim_path)
abstractmethod
Copies the prim at @source_prim_path, and its whole subtree, to @dest_prim_path.
create_annotator(raw_modality_name)
abstractmethod
Creates (but does not yet attach) a backend-specific annotator for @raw_modality_name (one of VisionSensor.RAW_SENSOR_TYPES' values).
Returns:
| Type | Description |
|---|---|
object
|
Opaque handle to be passed to attach_modality/detach_modality/get_modality_data. |
Source code in OmniGibson/omnigibson/render_backends/base.py
create_camera_resource(prim_path, resolution, force_new=False)
abstractmethod
Creates a backend-specific rendering resource (e.g. a Replicator render product) for the camera prim at @prim_path, sized to @resolution = (width, height). @force_new forces creation of a new resource even if the backend has a stale cached one at the same @prim_path (needed when recreating a resource right after destroying the previous one at the same path).
Returns:
| Type | Description |
|---|---|
object
|
Opaque handle to be passed to attach_modality/destroy_camera_resource. |
Source code in OmniGibson/omnigibson/render_backends/base.py
create_default_pbr_material(scope_path, material_path, target_prim_path)
abstractmethod
Creates a default PBR material at @material_path (under a Scope authored at @scope_path) and binds it to @target_prim_path.
Source code in OmniGibson/omnigibson/render_backends/base.py
create_fabric_hierarchy()
Creates the Fabric/usdrt stage mirror and hierarchy interface this backend reads poses through, if it has one.
Returns:
| Type | Description |
|---|---|
2 - tuple
|
(usdrt_stage, fabric_hierarchy), both None if this backend has no Fabric mirror (pose reads then go through raw pxr / the physics backend's own state instead). |
Source code in OmniGibson/omnigibson/render_backends/base.py
create_primitive_mesh(primitive_type, prim_path, u_patches=None, v_patches=None, stage=None)
abstractmethod
Authors a @primitive_type mesh (one of PRIMITIVE_MESH_TYPES) at @prim_path, optionally
tessellated to @u_patches x @v_patches.
Source code in OmniGibson/omnigibson/render_backends/base.py
deactivate_prim(prim)
abstractmethod
delete_prim(prim_path, destructive=True)
abstractmethod
Deletes the prim at @prim_path. @destructive=False deactivates it instead of removing it, which is all that is possible for a prim whose definition comes from a reference arc.
Source code in OmniGibson/omnigibson/render_backends/base.py
destroy_camera_resource(camera_resource)
abstractmethod
detach_modality(annotator, camera_resource)
abstractmethod
Detaches @annotator from @camera_resource. Tolerates backend-specific teardown quirks.
enable_extensions()
get_modality_data(annotator, device=None)
abstractmethod
Returns:
| Type | Description |
|---|---|
dict or array
|
The current raw observation for @annotator -- either a dict with "data"/"info" keys or a direct array/tensor, depending on modality (mirrors the underlying annotator's own return convention). @device, if given, requests data placed on that device. |
Source code in OmniGibson/omnigibson/render_backends/base.py
get_stage()
abstractmethod
is_prim_ancestral(prim)
abstractmethod
Returns:
| Type | Description |
|---|---|
bool
|
Whether @prim's own definition was introduced via a reference arc (e.g. a link inside a dataset object's referenced USD), as opposed to being authored directly on the live stage. Such a prim can only be deactivated, never removed. |
Source code in OmniGibson/omnigibson/render_backends/base.py
recompute_extents(prim)
abstractmethod
render()
abstractmethod
Advance/tick the render graph by one frame (a Kit app-update + RTX draw, or equivalent). Does
NOT itself return pixel data -- that is a later phase's capture_modality()-style method.
Source code in OmniGibson/omnigibson/render_backends/base.py
setup_viewer_camera(viewer_width, viewer_height)
Creates the interactive viewer camera at the given resolution, if this backend has a viewport.
suppress_log(channels=None)
abstractmethod
Returns:
| Type | Description |
|---|---|
contextmanager
|
Suppresses @channels (or all logging, if None) for its duration. |