Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Google deepmind Mujoco MJWarp Render

From Leeroopedia
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

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

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment