Migrate filament header documentation to docs.

PiperOrigin-RevId: 948294877
Change-Id: I6e110bbdc4d2e329a243f1b96d560698174de26b
This commit is contained in:
Haroon Qureshi
2026-07-15 06:14:09 -07:00
committed by Copybara-Service
parent b60609d2a1
commit 1e85ce176f
10 changed files with 1104 additions and 185 deletions
+18 -30
View File
@@ -22,21 +22,22 @@ Parser
Compiler
The compiler is written in C++. It takes an mjCModel C++ object constructed by the parser, and converts it into an
mjModel C structure used at runtime.
Abstract visualizer
The abstract visualizer is written in C. It generates a list of abstract geometric entities representing the
simulation state, with all information needed for actual rendering. It also provides abstract mouse hooks for camera
and perturbation control.
OpenGL renderer
The renderer is written in C and is based on fixed-function OpenGL. It does not have all the features of
state-of-the-art rendering engines (and can be replaced with such an engine if desired) but nevertheless it provides
efficient and informative 3D rendering.
Thread
The threading framework is written in C++ and exposed in C. It provides a thread pool interface
to process tasks asynchronously. To enable use in MuJoCo, call ``mju_threadpool``.
Rendering
There are two rendering libraries provided by MuJoCo. The :ref:`classic rendering<OpenGLrendering>` library is
written in C and uses OpenGL 1.5. It provides a simple and efficient way to visualize MuJoCo models. The
:ref:`filament rendering<FilamentRendering>` library is written in C++ and uses the externally-devloped Filament
rendering engine. It provides more modern and feature-rich real-time rendering capabilities.
Abstract visualizer
The abstract visualizer is written in C. It generates a list of abstract geometric entities representing the
simulation state, with all information needed for rendering with the Classic renderer. It also provides abstract
mouse hooks for camera and perturbation control.
UI framework
The UI framework is written in C. UI elements are rendered in OpenGL. It has its own event
mechanism and abstract hooks for keyboard and mouse input. The code samples use it with GLFW, but it can also be used
with other window libraries.
The UI framework is written in C and is designed to work with the :ref:`classic OpenGL renderer<OpenGLrendering>`.
UI elements are rendered in OpenGL. It has its own event mechanism and abstract hooks for keyboard and mouse input.
The code samples use it with GLFW, but it can also be used with other window libraries.
.. _inStart:
@@ -236,14 +237,16 @@ to which the symbol belongs. First we list the prefixes corresponding to type de
Primitive type, for example :ref:`mjtNum` and :ref:`mjtGeom`. Most types in this family are enums.
``mjf``
Callback function type, for example :ref:`mjfGeneric`.
``mjs``
Data structure related to :doc:`procedural model editing <modeledit>`, for example :ref:`mjsJoint`.
``mjv``
Data structure related to abstract visualization, for example :ref:`mjvCamera`.
``mjrf``
Data structure related to filament rendering, for example :ref:`mjrfContext`.
``mjr``
Data structure related to OpenGL rendering, for example :ref:`mjrContext`.
``mjui``
Data structure related to UI framework, for example :ref:`mjuiSection`.
``mjs``
Data structure related to :doc:`procedural model editing <modeledit>`, for example :ref:`mjsJoint`.
Next we list the prefixes corresponding to function definitions. Note that function prefixes always end with underscore.
@@ -256,6 +259,8 @@ Next we list the prefixes corresponding to function definitions. Note that funct
in the sense that they do not have mjModel and mjData pointers as their arguments.
``mjv_``
Function related to abstract visualization, for example :ref:`mjv_updateScene`.
``mjrf_``
Function related to filament rendering, for example :ref:`mjrf_render`.
``mjr_``
Function related to OpenGL rendering, for example :ref:`mjr_render`.
``mjui_``
@@ -268,23 +273,6 @@ Next we list the prefixes corresponding to function definitions. Note that funct
``mjs_``
Functions for :doc:`procedural model editing <modeledit>`, for example :ref:`mjs_addJoint`.
.. _inOpenGL:
Using OpenGL
~~~~~~~~~~~~
The use of MuJoCo's native OpenGL renderer will be explained in :ref:`Rendering`. For rendering, MuJoCo uses OpenGL 1.5
in the compatibility profile with the ``ARB_framebuffer_object`` and ``ARB_vertex_buffer_object`` extensions. OpenGL
symbols are loaded via `GLAD <https://github.com/Dav1dde/glad>`_ the first time the :ref:`mjr_makeContext` function
is called. This means that the MuJoCo library itself does not have an explicit dependency on OpenGL and can be used
on systems without OpenGL support, as long as ``mjr_`` functions are not called.
Applications that use MuJoCo's built-in rendering functionalities are responsible for linking against an appropriate
OpenGL context creation library and for ensuring that there is an OpenGL context that is made current on the running
thread. On Windows and macOS, there is a canonical OpenGL library provided by the operating system. On Linux, MuJoCo
currently supports GLX for rendering to an X11 window, OSMesa for headless software rendering, and EGL for hardware
accelerated headless rendering.
.. toctree::
:hidden: