Skip to content

Viewer refactor#522

Merged
mmacklin merged 45 commits into
newton-physics:mainfrom
mmacklin:viewer-updates
Aug 19, 2025
Merged

Viewer refactor#522
mmacklin merged 45 commits into
newton-physics:mainfrom
mmacklin:viewer-updates

Conversation

@mmacklin

@mmacklin mmacklin commented Aug 11, 2025

Copy link
Copy Markdown
Member

Description

image
  • Introduce new unified Viewer class that provides render agnostic way to log simulation data
  • Refactor OpenGL viewer code to no longer depend on Warp renderer
  • Add support for shadow mapping and basic lighting
  • Add Rerun backend
  • Add UI frontend for selection API
  • Add support for more visual information to the newton.Mesh class (normals, uvs, colors)
  • Integrate recording interface

New example in example_viewer.py - basic usage:

while viewer.is_running():

   solver.step(state_in, state_out, control, contacts, dt)

   viewer.begin_frame(t)
   viewer.log_model(state)
   viewer.end_frame()

Todo:

  • Update examples to use new Viewer app by default (will come in a separate PR)

Newton Migration Guide

The Viewer class and backends replace the previous warp.sim classes:

  • warp.sim.render.SimRenderer → newton.viewer.ViewerBase (interface)
  • warp.sim.render.SimRendererOpenGL → newton.viewer.ViewerGL
  • warp.sim.render.SimRendererUsd → newton.viewer.ViewerUSD
  • The migration guide in docs/migration.rst is up-to date

Before your PR is "Ready for review"

  • All commits are signed-off to indicate that your contribution adheres to the Developer Certificate of Origin requirements
  • Necessary tests have been added and new examples are tested (see newton/tests/test_examples.py)
  • Documentation is up-to-date
  • Code passes formatting and linting checks with pre-commit run -a

Summary by CodeRabbit

  • New Features

    • Unified viewer with three backends (OpenGL interactive, USD export, Rerun) and a CLI demo.
  • Enhancements

    • Interactive UI: ImGui panels, camera controls, file dialogs, FPS/stats overlay, selection/inspection, picking/dragging.
    • Richer rendering: instanced primitives & meshes, per-instance colors/materials, shaders, shadowing, and primitive mesh generators.
    • Mesh format now supports normals, UVs, and per-mesh color.
  • Other

    • World-space contact-point computation path removed (may affect contact rendering).

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants