Skip to content

Commit 444be6b

Browse files
andrewkaufmanclaude
andcommitted
Fix show_ground toggle for ViewerRTX
The RTX viewer's render phase bypasses the _shape_instances loop that drives _should_show_shape(), so plane visibility never updated when show_ground was toggled. Track _last_show_ground and push visibility updates for PLANE batches into _pending_instance_visibility on change; end_frame() already flushes these to OVRTX each frame. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 54ef3a6 commit 444be6b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎newton/_src/viewer/viewer_rtx.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,8 +1291,15 @@ def log_state(self, state: newton.State) -> None:
12911291
else:
12921292
# Render phase: flat arrays (built at end of build phase) handle all shape
12931293
# transform updates in a single kernel launch — no per-batch work needed here.
1294+
show_ground = self.show_ground
1295+
show_ground_changed = show_ground != self._last_show_ground
12941296
for shapes in self._shape_instances.values():
12951297
shapes.colors_changed = False
1298+
if show_ground_changed and int(shapes.geo_type) == int(newton.GeoType.PLANE):
1299+
qualified = self._qualify(shapes.name)
1300+
self._pending_instance_visibility[qualified] = show_ground
1301+
if show_ground_changed:
1302+
self._last_show_ground = show_ground
12961303

12971304
self._log_gaussian_shapes(state)
12981305
self._log_non_shape_state(state)
@@ -2063,6 +2070,7 @@ def clear_model(self) -> None:
20632070

20642071
self._last_state = None
20652072
self._last_control = None
2073+
self._last_show_ground = True
20662074

20672075
# reset camera
20682076
self.camera = Camera(width=self._render_width, height=self._render_height, up_axis=self._up_axis)

0 commit comments

Comments
 (0)