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.

Principle:Google deepmind Mujoco Offscreen Rendering

From Leeroopedia
Knowledge Sources
Domains Rendering, Computer_Vision, OpenGL
Last Updated 2026-02-15 06:00 GMT

Overview

Technique for rendering simulation frames to an off-screen buffer for pixel capture without displaying a window.

Description

Offscreen Rendering allows capturing RGB and depth images from MuJoCo simulations without a display. This is essential for headless servers, dataset generation, video recording, and vision-based reinforcement learning. MuJoCo supports three offscreen backends: EGL (GPU-accelerated, Linux), OSMesa (software, cross-platform), and GLFW hidden window (GPU, cross-platform). The offscreen framebuffer is managed by mjrContext and pixels are read back with mjr_readPixels.

Usage

Use this principle for headless rendering, video recording, generating training datasets for computer vision, or vision-based RL observations. Choose EGL for GPU-accelerated headless rendering on Linux servers.

Theoretical Basis

Offscreen rendering uses the same OpenGL pipeline as on-screen but targets a Framebuffer Object (FBO):

  1. Buffer selection: Switch to offscreen FBO via mjr_setBuffer(mjFB_OFFSCREEN)
  2. Viewport query: Get maximum offscreen resolution via mjr_maxViewport
  3. Render: Normal mjr_render call (targets offscreen FBO)
  4. Readback: mjr_readPixels copies pixel data from GPU to CPU memory
  5. Process: RGB and/or depth arrays are available for saving or processing

Related Pages

Implemented By

Page Connections

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