MuGS: MuJoCo + 3D Gaussian Splatting for Photorealistic Robot Simulation
MuGS is a hybrid rendering pipeline that combines MuJoCo physics simulation with 3D Gaussian Splatting (3DGS) photorealistic backgrounds to create photo-realistic robot simulation environments for Vision-Language-Action (VLA) model training and evaluation.
Demo — DISCOVERSE 3DGS rooms × AndroidTwin multi-cam rollout
Four cameras, one rollout, one shared world_T_gs rigid alignment. The
G1 + Inspire FTP stands via AMO inside the DISCOVERSE lab3 3DGS room;
each frame is captured from the robot's first-person head_cam plus
three world cams (front-diagonal, over-the-shoulder, low side hero).
The composite below stitches all four panes — every panel is a hybrid
MuGS render (3DGS bg + MuJoCo fg, alpha-blended per camera).

| Camera |
View |
robot/head_cam (first-person, D435 mount, 47° down, 42° vfov) |
 |
world_cam (front-diagonal) |
 |
world_back_cam (over-the-shoulder back) |
 |
world_side_cam (low hero shot) |
 |
Two pieces of plumbing make this work compared to the kitchen demo
below:
- One alignment for all cams.
MuGSRecorder accepts a world_T_gs
4×4 transform that maps MJ-world → GS-world. Every simultaneous camera
applies the same transform to its live MJ pose, so the four views see
the same room from coherent perspectives without per-cam initial-pose
snapping.
- OpenGL → OpenCV Y-flip. gsplat is OpenCV (+Y down). MuGS internally
negates column 2 of the cam rotation (Z forward), so the recorder
pre-negates column 1 in the
world_T_gs branch. Without this, every
level-horizon world cam renders upside-down; the first-person head cam
survives unflipped only because its 47° pitch coincidentally lines up.
Get the scene:
bash scripts/data_collection/download_discoverse_scenes.sh # default: lab3
Render the demo (from the AndroidTwin repo, scene path adjusted):
.venv/bin/python examples/discoverse_room_rollout.py \
--bg-ply /path/to/MuGS/assets/scenes/discoverse_unpacked/lab3/point_cloud.ply \
--out-dir outputs/discoverse_lab3 \
--num-steps 120 --width 480 --height 360 \
--gs-fx 380 --gs-fy 380 --yaw-deg 180
See docs/discoverse_scenes.md for the
scene catalog, alignment knobs (yaw_deg, GS focal, floor 5%-percentile,
bbox-center vs median), and the training-cam convex-hull caveat that
makes some camera placements render dim/noisy.
What is MuGS?
MuGS enables photorealistic robot simulation by compositing physically accurate MuJoCo robot renders with real-world 3DGS backgrounds at 5000+ FPS. It bridges the Sim2Real gap for vision-based robot learning by providing training data that looks like real photos while maintaining perfect physics simulation.
Key Innovation: Two-stage rendering pipeline
- Stage 1: MuJoCo renders robot/objects (CPU-based, fast)
- Stage 2: 3DGS renders background (GPU-based, photorealistic)
- Compositing: Alpha-blending with automatic segmentation masks

AndroidTwin × MuGS — G1 humanoid in INRIA kitchen
Hybrid render demo from the AndroidTwin humanoid bench
(Unitree G1 + Inspire FTP 5-finger hands, 53 dof) composited on the
INRIA mip-NeRF 360 kitchen 3DGS scene.
Task: p1_amo_table_grasp (4 GraspNet objects on a table, AMO
whole-body controller, head_cam first-person view), zero-policy
30-step rollout.
Pipeline — body-prefix masking

scene_inspire.xml leaves geoms unnamed, so the recorder resolves
foreground pixels by body name prefix instead of geom name.
SceneCfg attaches each entity with a namespace prefix (robot/,
table/, obj_NNN/, grasp_cube/…); any geom whose parent body
matches one of the configured prefixes joins the fg mask.
| panel |
what |
| 1. MuJoCo foreground |
mujoco.Renderer.render() at robot/head_cam |
| 2. Geom segmentation |
enable_segmentation_rendering() raw geom-id channel |
| 3. FG mask |
np.isin(seg, fg_geom_ids) → 29.3% coverage on this view |
Hybrid render — bg cam tracks MuJoCo head

3DGS scenes live in COLMAP world frames disjoint from MuJoCo world.
The recorder pins the initial GS bg pose to a training cam
(kitchen cam[0]) and assumes it coincides with the initial MuJoCo
head_cam pose; on each capture it applies the MuJoCo-frame head_cam
delta (rotated into GS frame) on top of that initial pose so the bg
tracks head motion. Intrinsics stay fixed at the kitchen training
cam's fx/fy.
R_align = R_gs0 · R_mj0ᵀ # one-shot at first capture
pos_t = pos_gs0 + R_align · (pos_mj_t − pos_mj_0)
R_t = R_align · R_mj_t
Static vs tracked background

Same MuJoCo frame, two bg policies:
- Left (static) —
bg_t == bg_0 for every capture; bg-region
pixel diff stays at 0.05/255 (just libx264 noise).
- Right (tracked) — bg follows head motion; bg-region pixel
diff rises to ~90/255 by frame 5 (kitchen content shifts as expected).
Animation

16-frame loop @ 10 fps, 320×240 (downsampled from 31-frame mp4 at
640×480). Top of frame turns black mid-rollout because the head
pitches down enough that the bg cam looks above the kitchen ply's
trained volume — a known tradeoff of the no-scale-calibration
assumption.
Reproduce
uv run at-eval \
--task p1_amo_table_grasp --policy zero \
--num-episodes 1 --max-episode-steps 30 \
--camera robot/head_cam \
--render-backend mugs --mugs-mode hybrid \
--mugs-ply /path/to/kitchen/point_cloud.ply \
--mugs-bg-cam-json /path/to/kitchen/cameras.json \
--mugs-bg-cam-idx 0 \
--eval-dir outputs/evals_mugs_hybrid
MUJOCO_GL=egl required on headless servers. The wrapper
(MuGSRecorder) lives at androidtwin/envs/mugs_recorder.py in the
AndroidTwin repo and uses MuGS's standalone GaussianSensor API.
Features
Core Rendering
- Hybrid Rendering: 3DGS background + MuJoCo foreground @ 5000+ FPS
- Physics-Accurate: Full MuJoCo physics simulation with contact dynamics
- Photorealistic: 3D Gaussian Splatting for realistic backgrounds from real-world scans
- Camera Aligned: Automatic camera parameter extraction and coordinate system conversion
- Flexible Modes:
hybrid, 3dgs_only, mujoco_only rendering modes
Integration & Usability
- Easy Integration: Drop-in
GaussianSensor API for standalone use
- Batch Rendering: mjlab integration for parallel multi-environment rendering (
mugs_mjlab.tasks: ready-to-use env configs + benchmark runner — 4096 envs in one batched warp + gsplat call)
- Automatic Masking: Body-prefix or geom-name based foreground segmentation
- Camera Tracking: Dynamic background camera follows MuJoCo camera motion
Post-Processing (Optional)
- Super-Resolution: AI upscaling (Real-ESRGAN) for photorealistic detail
- Low-res rendering (320×240) → High-res output (1280×960)
- 4x upscaling with photorealistic texture enhancement
- Modular design: lazy-loaded, GPU-accelerated, batch processing support
Asset Support
- Pretrained Scenes: INRIA kitchen (mip-NeRF 360 dataset)
- External Assets: GS-Playground scenes, DISCOVERSE tasks (via download scripts)
- Custom Scenes: Support for any 3DGS PLY files from COLMAP / Nerfstudio — shoot your own with
docs/guides/GS_VIDEO_CAPTURE.md (phone-camera 三圈拍法, 中文实操向)
Quick Start
Basic Rendering
from mugs.sensors import GaussianSensor, GaussianSensorConfig
# 1. Configure sensor
config = GaussianSensorConfig(
width=640,
height=480,
background_ply_path="path/to/point_cloud.ply",
render_mode="hybrid", # "hybrid" | "3dgs_only" | "mujoco_only"
robot_geom_names=["link1", "link2", "gripper"],
)
sensor = GaussianSensor(config)
# 2. Render
result = sensor.render(model, data, camera_name, return_components=True)
# 3. Access components
rgb = result['rgb'] # Final hybrid image (H, W, 3) uint8
foreground = result['foreground'] # MuJoCo only
background = result['background'] # 3DGS only
mask = result['mask'] # Blending mask
Batched parallel rendering (mjlab)
Run thousands of envs in parallel with one batched mjwarp render + one
gsplat rasterization call. mugs_mjlab.tasks ships a YAM lift-cube task
config with a GaussianSensorMjlab pre-attached to the wrist camera, plus a
generic benchmark runner that works for any ManagerBasedRlEnvCfg factory: