Add Newton MPM surface rendering to the teapot demo - #7640
Conversation
…tion # Conflicts: # source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
…tion # Conflicts: # pyproject.toml # uv.lock
…tion # Conflicts: # source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py # source/isaaclab_visualizers/test/test_newton_adapter.py
Greptile SummaryThe PR adds GPU-reconstructed MPM fluid surfaces to the teapot demo and introduces staged dynamic-mesh submission for Newton GL and RTX viewers. It also applies RTX particle coloring consistently and improves filtering of generated and nested collider visuals.
Confidence Score: 4/5The PR appears safe to merge after addressing the non-blocking Newton GL paused-mesh publication gap. Active, headless on-demand, and RTX paused rendering paths submit staged meshes correctly, but a one-time mesh registration or update made while Newton GL is paused remains queued until rendering resumes. Files Needing Attention: source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[MPM simulation step] --> B[ParticleSurface extraction]
B --> C[FluidSurfaceRenderer.log_mesh]
C --> D[Per-visualizer pending mesh map]
D --> E{Viewer lifecycle}
E -->|Newton GL/RTX active frame| F[Begin frame]
F --> G[Log state and staged mesh]
G --> H[End frame]
E -->|Newton RTX paused| I[Paused frame and staged mesh flush]
E -->|Newton GL paused| J[UI update only]
Reviews (1): Last reviewed commit: "Support concurrent Newton teapot visuali..." | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
The staged Newton mesh API and teapot surface reconstruction are generally well integrated, but two compatibility paths need correction: the demo no longer configures the previously supported newton selector, and staged meshes are not published for models with no rigid bodies.
- Design and architecture: Name-keyed mesh staging appropriately encapsulates Newton's
begin_frame()/end_frame()lifecycle across interactive, paused, and headless rendering. However, the interactive step path returns whenbody_qis empty before flushing pending meshes, so particle-only or otherwise body-less models cannot publish staged geometry despite the documented next-frame contract. - API:
log_mesh()closely follows the Newton viewer signature and coalesces updates as intended. The demo's visualizer configuration now recognizes onlynewton_glandnewton_rtx, dropping the priornewtonalias even though the surface-renderer selection still recognizes it; the selector must be handled consistently to preserve existing behavior. - Implementation: The surface renderer reuses reconstruction storage, separates CUDA graph capture from physics capture, handles empty meshes, and stages updates through the visualizer API. The accepted issues are confined to selector handling and the empty-body early-return placement; the cloner's generated proxy-visual hiding rule is explicitly implemented and tested as broader behavior, so the proposed objection to that rule is not sufficiently supported as a defect.
Minor fixes needed. Posted 2 actionable findings inline.
Automated review; human maintainers own approval decisions.
|
run-ci |
|
run-ci |
Description
Add GPU surface reconstruction for the Newton MPM teapot-fill demo so fluid can be rendered as a coherent translucent surface instead of only as individual particles.
The implementation follows Newton 1.6's reusable
ParticleSurfaceworkflow: reconstruction storage is allocated once, CUDA work is graph-captured when enabled, and only the latest dynamic mesh update is staged for the next viewer frame. No new dependency is introduced; the change uses the Newton 1.6 version already pinned ondevelop.The demo now provides:
--fluid_render_mode particles|surface|both, defaulting tosurfaceTo keep the viewer lifecycle encapsulated,
NewtonVisualizer.log_mesh()stages mesh registrations and topology updates and submits them between the viewer'sbegin_frame()andend_frame()calls. It supports interactive, paused, and headless rendering paths while coalescing repeated updates by mesh name.This also fixes two rendering issues exposed by the demo:
NewtonRTXVisualizernow honors its configured particle color for Newton's canonical particle batch without changing user-defined point clouds.The Kit visualizer remains particle-only because this surface path targets Newton's GL/RTX viewer mesh API.
Type of change
Release backport
developScreenshots
No screenshot attached. The teapot-fill demo was exercised interactively with Newton GL, Newton RTX, and Kit during development.
Validation
uv run --no-sync pytest source/isaaclab_visualizers/test/test_newton_adapter.py source/isaaclab_newton/test/cloner/test_visual_shape_import.py -q— 69 passeduv run --no-sync isaaclab -f— passeduv run --no-sync python tools/changelog/cli.py check develop— passeduv run --no-sync python scripts/demos/mpm/teapot_fill.py --help— passeduv run --isolated --extra dev -- make -C docs current-docs— passed with warnings treated as errorsChecklist
pre-commitchecks withuv run isaaclab -fsource/<pkg>/changelog.d/for every touched packageCONTRIBUTORS.md