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 Platform Renderer

From Leeroopedia
Revision as of 12:46, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Google_deepmind_Mujoco_Platform_Renderer.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Rendering, Backend Abstraction
Last Updated 2026-02-15 04:00 GMT

Overview

Provides a unified rendering abstraction that initializes and manages either the classic OpenGL or the Filament rendering backend for MuJoCo.

Description

renderer.cc implements the Renderer class which serves as a backend-agnostic rendering layer. At construction, it selects the appropriate backend based on compile-time defines: MUJOCO_RENDERER_CLASSIC_OPENGL uses EGL context creation and OpenGL ImGui integration, while the Filament path uses mjr_makeFilamentContext with graphics API selection (OpenGL, OpenGL headless, or Vulkan). The Init method creates the mjrContext and mjvScene, and Deinit frees these resources. The Filament configuration supports multiple API backends via MUJOCO_RENDERER_FILAMENT_OPENGL, MUJOCO_RENDERER_FILAMENT_VULKAN, etc.

Usage

Instantiated by Studio's App class with the native window handle. The renderer is reinitialized each time a new model is loaded, and destroyed on cleanup. It provides the mjrContext and mjvScene used by all subsequent rendering operations.

Code Reference

Source Location

Key Functions

Renderer::Renderer(void* native_window);
Renderer::~Renderer();
void Renderer::Init(const mjModel* model);
void Renderer::Deinit();
// Compile-time backend selection: MUJOCO_RENDERER_CLASSIC_OPENGL vs Filament

Import

#include "experimental/platform/renderer.h"

I/O Contract

Inputs

Name Type Required Description
native_window void* No Native window handle (nullptr for offscreen/headless)
model const mjModel* Yes MuJoCo model for context and scene initialization

Outputs

Name Type Description
render_context_ mjrContext Initialized rendering context (OpenGL or Filament)
scene_ mjvScene Allocated visualization scene with capacity for 2000 geoms

Related Pages

Page Connections

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