Implementation:Google deepmind Mujoco MJWarp Render
| Knowledge Sources | |
|---|---|
| Domains | Physics_Simulation, GPU_Computing, NVIDIA_Warp |
| Last Updated | 2026-02-15 04:00 GMT |
Overview
MJWarp Render implements GPU-accelerated ray-traced rendering of MuJoCo scenes with lighting, textures, and material support.
Description
This module provides a complete GPU ray-tracing renderer for MuJoCo scenes. It casts rays from the camera through each pixel, finds the closest geometry intersection using BVH-accelerated queries, samples textures (for planes and meshes), computes Phong-style lighting with ambient, diffuse, and specular components, and handles shadow rays for light occlusion. The renderer supports all MuJoCo geometry types and outputs RGBA pixel buffers.
Usage
Called via render(m, d, rc) to produce rendered images of the simulation state. Requires a RenderContext created by create_render_context from the IO module containing pre-computed ray arrays and BVH structures.
Code Reference
Source Location
- Repository: Google_deepmind_Mujoco
- File: mjx/mujoco/mjx/third_party/mujoco_warp/_src/render.py
- Lines: 1-696
Key Functions
# Primary entry point
def render(m: Model, d: Data, rc: RenderContext)
# Ray casting and shading
def sample_texture(geom_type, mesh_faceadr, geom_id, tex_repeat, tex, ...)
def cast_ray(...)
def cast_ray_first_hit(...)
def compute_lighting(...)
Import
from mujoco.mjx.third_party.mujoco_warp._src.render import render
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| m | Model | Yes | Warp model with geometry, material, texture, and light definitions |
| d | Data | Yes | Warp simulation data with current transforms |
| rc | RenderContext | Yes | Render context with camera rays, BVH, and output pixel buffer |
Outputs
| Name | Type | Description |
|---|---|---|
| rc.pixels | wp.array | RGBA pixel buffer with rendered image |