Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions genesis/vis/batch_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ def retrieve_rigid_meshes_static(self):
args["geom_sizes"] = np.ones((self.n_vgeoms, 3), dtype=np.float32)
args["enabled_geom_groups"] = self.default_enabled_geom_groups

# Heterogeneous entities: a vgeom variant may exist in only a subset of envs
# (vgeom.active_envs_mask). Emit an optional [num_worlds, num_geoms] visibility
# mask (1 = visible, 0 = hidden) so each variant renders only where it is active;
# omitted for homogeneous scenes (legacy + back-compat with older Madrona).
if any(vgeom.active_envs_mask is not None for vgeom in vgeoms):
num_worlds = max(self.rigid_solver.n_envs, 1)
geom_env_mask = np.ones((num_worlds, self.n_vgeoms), dtype=np.int32)
for vgeom in vgeoms:
if vgeom.active_envs_mask is not None:
geom_env_mask[:, vgeom.idx] = vgeom.active_envs_mask.detach().cpu().numpy()
args["geom_env_mask"] = geom_env_mask

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate geom_env_mask on the installed Madrona API

In a default Linux install this repo still pins gs-madrona==0.0.7.post2 in pyproject.toml, while the renderer-side API that accepts geom_env_mask lives in a separate gs-madrona change. For any heterogeneous scene this line adds a new kwarg that the pinned MadronaBatchRenderer binding does not accept, so BatchRenderer.build() fails before rendering instead of preserving the previous behavior; please bump the dependency in this change or only emit the key when the installed adapter supports it.

Useful? React with 👍 / 👎.


# Retrieve material data
geom_mat_ids = []
num_materials = 0
Expand Down
Loading