Migrate filament header documentation to docs.
PiperOrigin-RevId: 948294877 Change-Id: I6e110bbdc4d2e329a243f1b96d560698174de26b
This commit is contained in:
committed by
Copybara-Service
parent
b60609d2a1
commit
1e85ce176f
@@ -38,6 +38,7 @@ API function can be classified as:
|
||||
- :ref:`Abstract interaction<Interaction>`: mouse control of cameras and perturbations.
|
||||
- :ref:`Abstract Visualization<Visualization-api>`.
|
||||
- :ref:`OpenGL rendering<OpenGLrendering>`.
|
||||
- :ref:`Filament rendering<FilamentRenderingApi>`.
|
||||
- :ref:`UI framework<UIframework>`.
|
||||
|
||||
- **Threads, Plugins, Derivatives**
|
||||
|
||||
@@ -4,13 +4,16 @@ Types
|
||||
|
||||
MuJoCo defines a large number of types:
|
||||
|
||||
- Two :ref:`primitive types<tyPrimitive>`.
|
||||
- Four :ref:`primitive types<tyPrimitive>`: :ref:`mjtNum<mjtNum>`, :ref:`mjtByte<mjtByte>`, :ref:`mjtBool<mjtBool>`, and
|
||||
:ref:`mjtSize<mjtSize>`.
|
||||
|
||||
- :ref:`C enum types<tyEnums>` used to define categorical values. These can be classified as:
|
||||
|
||||
- Enums used in :ref:`mjModel<tyModelEnums>`.
|
||||
- Enums used in :ref:`mjData<tyDataEnums>`.
|
||||
- Enums for abstract :ref:`visualization<tyVisEnums>`.
|
||||
- Enums used by the :ref:`renderer<tyRenderEnums>`.
|
||||
- Enums used by the :ref:`classic renderer<tyRenderEnums>`.
|
||||
- Enums used by the :ref:`filament renderer<tyFilamentRenderEnums>`.
|
||||
- Enums used by the :ref:`mjUI<tyUIEnums>` user interface package.
|
||||
- Enums used by :ref:`engine plugins<tyPluginEnums>`.
|
||||
- Enums used for :ref:`procedural model manipulation<tySpecEnums>`.
|
||||
@@ -31,7 +34,8 @@ MuJoCo defines a large number of types:
|
||||
- :ref:`Auxiliary struct types<tyAuxStructure>`, also used by the engine.
|
||||
- Structs for collecting :ref:`simulation statistics<tyStatStructure>`.
|
||||
- Structs for :ref:`abstract visualization<tyVisStructure>`.
|
||||
- Structs used by the :ref:`renderer<tyRenderStructure>`.
|
||||
- Structs used by the :ref:`classic renderer<tyRenderStructure>`.
|
||||
- Structs used by the :ref:`filament renderer<tyFilamentRenderStructure>`.
|
||||
- Structs used by the :ref:`UI framework<tyUIStructure>`.
|
||||
- Structs used for :ref:`procedural model manipulation<tySpecStructure>`.
|
||||
- Structs used by :ref:`engine plugins<tyPluginStructure>`.
|
||||
@@ -737,7 +741,7 @@ These are the possible font types.
|
||||
mjrPixelFormat
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
There are the possible values:
|
||||
These are the possible values:
|
||||
|
||||
.. mujoco-include:: mjrPixelFormat
|
||||
|
||||
@@ -746,7 +750,7 @@ There are the possible values:
|
||||
mjrVertexAttributeUsage
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
There are the possible values:
|
||||
These are the possible values:
|
||||
|
||||
.. mujoco-include:: mjrVertexAttributeUsage
|
||||
|
||||
@@ -755,7 +759,7 @@ There are the possible values:
|
||||
mjrVertexAttributeType
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
There are the possible values:
|
||||
These are the possible values:
|
||||
|
||||
.. mujoco-include:: mjrVertexAttributeType
|
||||
|
||||
@@ -764,7 +768,7 @@ There are the possible values:
|
||||
mjrIndexType
|
||||
~~~~~~~~~~~~
|
||||
|
||||
There are the possible values:
|
||||
These are the possible values:
|
||||
|
||||
.. mujoco-include:: mjrIndexType
|
||||
|
||||
@@ -778,6 +782,34 @@ There are the possible values:
|
||||
.. mujoco-include:: mjrMeshPrimitiveType
|
||||
|
||||
|
||||
.. _tyFilamentRenderEnums:
|
||||
|
||||
Filament Rendering
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The enums below are defined in `mjrfilament.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjrfilament.h>`__.
|
||||
|
||||
|
||||
.. _mjrGraphicsApi:
|
||||
|
||||
mjrGraphicsApi
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
The underlying graphics API to use for Filament rendering.
|
||||
|
||||
.. mujoco-include:: mjrGraphicsApi
|
||||
|
||||
|
||||
.. _mjrDrawMode:
|
||||
|
||||
mjrDrawMode
|
||||
~~~~~~~~~~~
|
||||
|
||||
High-level control for how to draw objects in the scene for Filament rendering.
|
||||
|
||||
.. mujoco-include:: mjrDrawMode
|
||||
|
||||
|
||||
.. _tyUIEnums:
|
||||
|
||||
User Interface
|
||||
@@ -1306,6 +1338,263 @@ This structure contains the custom OpenGL rendering context, with the ids of all
|
||||
.. mujoco-include:: mjrContext
|
||||
|
||||
|
||||
.. _tyFilamentRenderStructure:
|
||||
|
||||
Filament Rendering
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The names of these struct types are prefixed with ``mjrf``. They are defined in
|
||||
`mjrfilament.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjrfilament.h>`__.
|
||||
|
||||
There are seven key types defined by this API: :ref:`mjrfContext<mjrfContext>`, :ref:`mjrfTexture<mjrfTexture>`,
|
||||
:ref:`mjrfMesh<mjrfMesh>`, :ref:`mjrfLight<mjrfLight>`, :ref:`mjrfRenderable<mjrfRenderable>`,
|
||||
:ref:`mjrfScene<mjrfScene>`, and :ref:`mjrfRenderTarget<mjrfRenderTarget>`.
|
||||
|
||||
Each object is created using a `create` function and destroyed using a `destroy` function, e.g. `mjrf_createTexture` and
|
||||
`mjrf_destroyTexture`. All objects require a :ref:`Context<mjrfContext>` in order to be created (with the exception of
|
||||
the :ref:`Context<mjrfContext>` object itself). Additionally, the `create` functions accept a pointer to a configuration
|
||||
struct (e.g. `mjrTextureConfig`) which describes the parameters for the object to be created. Each of these structs has
|
||||
a corresponding `default` function (e.g. `mjrf_defaultTextureConfig`) which can be used to initialize the struct to
|
||||
default values. The default values are assumed to be `0` or `NULL` unless otherwise specified.
|
||||
|
||||
|
||||
.. _mjrfContext:
|
||||
|
||||
mjrfContext
|
||||
~~~~~~~~~~~
|
||||
|
||||
The Context is the main entry point for the filament rendering library. It manages all the core filament objects that
|
||||
are responsible for the rendering of an image. All other objects (e.g. Textures, Meshes, Scenes, etc.) need a Context in
|
||||
order to be created.
|
||||
|
||||
Otherwise, the main function to use with the Context is :ref:`mjrf_render()<mjrf_render>` which performs the actual
|
||||
rendering of an image.
|
||||
|
||||
Filament uses a separate thread for rendering. However, despite that, this API is not thread-safe; calls are expected to
|
||||
be made from a single thread. Due to the asynchronous nature of filament, some APIs provide handles or callbacks to
|
||||
signal when an operation is complete. (Note: for WASM builds, filament does not use a separate thread.)
|
||||
|
||||
There are two key differences between the :ref:`mjrfContext<mjrfContext>` and the classic :ref:`mjrContext<mjrContext>`.
|
||||
Firstly, the filament context will manage the underlying graphics context itself. This means users do not need to
|
||||
initialize EGL or similar libraries beforehand. Secondly, the filament context is independent of a MuJoCo model. That
|
||||
means you can use a single :ref:`mjrfContext<mjrfContext>` instance to render images for multiple models.
|
||||
|
||||
.. _mjrfContextConfig:
|
||||
|
||||
mjrfContextConfig
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Parameters for creating :ref:`filament graphics context<mjrfContext>`.
|
||||
|
||||
.. mujoco-include:: mjrfContextConfig
|
||||
|
||||
|
||||
.. _mjrfTexture:
|
||||
|
||||
mjrfTexture
|
||||
~~~~~~~~~~~
|
||||
|
||||
A texture is a 2D or 3D (cubemap) image that adds visual detail to a rendered model, such as color or bumpiness, without
|
||||
increasing geometric complexity. A texture is simply a memory buffer holds pixel data, as well as metadata such as the
|
||||
dimensions of the image or the format of the pixels (e.g. 8-bit RGB).
|
||||
|
||||
.. _mjrfTextureConfig:
|
||||
|
||||
mjrfTextureConfig
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Parameters for creating a :ref:`texture<mjrfTexture>`.
|
||||
|
||||
.. mujoco-include:: mjrfTextureConfig
|
||||
|
||||
|
||||
.. _mjrfTextureData:
|
||||
|
||||
mjrfTextureData
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Binary data payload for a :ref:`texture<mjrfTexture>`.
|
||||
|
||||
.. mujoco-include:: mjrfTextureData
|
||||
|
||||
|
||||
.. _mjrfMesh:
|
||||
|
||||
mjrfMesh
|
||||
~~~~~~~~
|
||||
|
||||
A mesh describes the surface geometry of an object to be rendered. It is defined as a collection of vertices (i.e. a
|
||||
VertexBuffer), a set of indices (i.e. an IndexBuffer) that describes the order in which the vertices should be
|
||||
processed, and a primitive type that defined how the vertices are to be interpreted (e.g. triangles, lines, etc.) when
|
||||
rendering the surface.
|
||||
|
||||
Filament does not directly support normals. Instead, it encodes the normal, tangent, and bitangent into a 4-component
|
||||
quaternion describing the "orientation" of the vertex. Ideally, you should preprocess your assets to generate this data
|
||||
offline, but we will compute it on the fly if needed (at a performance cost).
|
||||
|
||||
Vertex data may or may not be interleaved. Interleaved data assumes that the attributes are packed in the order
|
||||
specified in the attributes array, with no padding in-between. Additionally, the `data` pointer for each attribute is
|
||||
assumed to point to the first element of that type. For non-interleaved data, each attribute is assumed to be stored in
|
||||
a separate array.
|
||||
|
||||
Additionally, the bounds of the mesh should be computed in order to allow the filament renderer to perform frustum-based
|
||||
culling. Alternatively, the bounds can be computed at runtime (though there is a small performance cost). If no bounds
|
||||
are provided (or calculated), then frustum culling will not be performed.
|
||||
|
||||
|
||||
.. _mjrfMeshData:
|
||||
|
||||
mjrfMeshData
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Binary data used for creating a :ref:`mesh<mjrfMesh>`.
|
||||
|
||||
.. mujoco-include:: mjrfMeshData
|
||||
|
||||
|
||||
.. _mjrfScene:
|
||||
|
||||
mjrfScene
|
||||
~~~~~~~~~
|
||||
|
||||
A Scene is a collection of :ref:`Lights<mjrfLight>` and :ref:`Renderables<mjrfRenderable>` that describes what is to be
|
||||
rendered.
|
||||
|
||||
|
||||
.. _mjrfSceneParams:
|
||||
|
||||
mjrfSceneParams
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Parameters for creating a :ref:`scene<mjrfScene>`.
|
||||
|
||||
.. mujoco-include: mjrfSceneParams
|
||||
|
||||
|
||||
.. _mjrfLight:
|
||||
|
||||
mjrfLight
|
||||
~~~~~~~~~
|
||||
|
||||
A light is a source of illumination. (Without lights, a rendered image will be completely black.) There are several
|
||||
different types of lights such as directional, spot, point, and image lights.
|
||||
|
||||
The primary light in a scene is the image light (also sometimes known as the environment light). This is a light that
|
||||
"surrounds" the entire scene and is defined as a 3D texture. Each "pixel" of the cubemap is interpreted as the color of
|
||||
projected into the scene from a particular direction.
|
||||
|
||||
The texture used for image-based lighting can be generated using filament's `cmgen` tool. The tool should be configured
|
||||
to output a KTX file from your source image. This tool calculates additional data (i.e. the spherical harmonics) and
|
||||
encodes that information into the KTX file.
|
||||
|
||||
Directional lights are the next most common type of light and is usually used to simulate the sun; a uniformly colored
|
||||
light that is emitted in a single direction.
|
||||
|
||||
Filament only supports a single image and directional light. You can define as many point or spot lights as you want.
|
||||
Each light source (except image based lights) may or may not cast shadows. Each shadow-casting light incurs a
|
||||
performance cost.
|
||||
|
||||
|
||||
.. _mjrfLightParams:
|
||||
|
||||
mjrfLightParams
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Parameters for creating a :ref:`light<mjrfLight>`.
|
||||
|
||||
.. mujoco-include:: mjrfLightParams
|
||||
|
||||
|
||||
.. _mjrfRenderable:
|
||||
|
||||
mjrfRenderable
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
A renderable is a single object that is to be drawn. It is defined as a combination of a :ref:`mjrfMesh<mjrfMesh>`
|
||||
(i.e. the shape or surface geometry, as described above) and a :ref:`mjrfMaterial<mjrfMaterial>` (i.e. a description of
|
||||
how the surface interacts with lights to product the final visual appearance).
|
||||
|
||||
|
||||
.. _mjrfRenderableParams:
|
||||
|
||||
mjrfRenderableParams
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Parameters for creating a :ref:`renderable<mjrfRenderable>`.
|
||||
|
||||
.. mujoco-include:: mjrfRenderableParams
|
||||
|
||||
|
||||
.. _mjrfMaterial:
|
||||
|
||||
mjrfMaterial
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Materials describe the properties of the surface of a renderable, effectively dictating how the surface interacts with
|
||||
lights to produce a final pixel color in the output image. Different lighting models will be applied to the surface
|
||||
depending on the values of the material properties. There there are three lighting models currently supported:
|
||||
|
||||
1. Metallic-roughness (PBR): this is the preferred model for rendering models based standard
|
||||
metallic-roughness workflows.
|
||||
|
||||
2. Specular-glossiness (non-PBR): this is a legacy model designed to be compatible with classic
|
||||
:ref:`mjr<Rendering>` renderer, though it is not 100% identical.
|
||||
|
||||
3. Unlit: this model ignores lighting and is used for rendering UX or decorative elements like
|
||||
contact forces and labels.
|
||||
|
||||
.. mujoco-include:: mjrfMaterial
|
||||
|
||||
|
||||
.. _mjrfRenderTarget:
|
||||
|
||||
mjrfRenderTarget
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
A RenderTarget is a memory buffer that holds the results of a rendering operation. (This is an alternative to rendering
|
||||
directly to the screen.)
|
||||
|
||||
|
||||
.. _mjrfRenderTargetConfig:
|
||||
|
||||
mjrfRenderTargetConfig
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Parameters for creating a :ref:`render target<mjrfRenderTarget>`.
|
||||
|
||||
.. mujoco-include:: mjrfRenderTargetConfig
|
||||
|
||||
|
||||
.. _mjrfRenderRequest:
|
||||
|
||||
mjrfRenderRequest
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
A single rendering operation.
|
||||
|
||||
.. mujoco-include:: mjrfRenderRequest
|
||||
|
||||
|
||||
.. _mjrfReadPixelsRequest:
|
||||
|
||||
mjrfReadPixelsRequest
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
A single pixel read operation.
|
||||
|
||||
.. mujoco-include:: mjrfReadPixelsRequest
|
||||
|
||||
|
||||
.. _mjrfFrameStats:
|
||||
|
||||
mjrfFrameStats
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Information about a single frame of rendering.
|
||||
|
||||
.. mujoco-include:: mjrfFrameStats
|
||||
|
||||
|
||||
.. _tyUIStructure:
|
||||
|
||||
User Interface
|
||||
|
||||
@@ -3048,6 +3048,506 @@ Call glGetError and return result.
|
||||
|
||||
Find first rectangle containing mouse, -1: not found.
|
||||
|
||||
.. _FilamentRenderingApi:
|
||||
|
||||
Filament rendering
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Rendering functions using the Filament rendering engine. These functions are prefixed with ``mjrf``. See
|
||||
:ref:`Filament Rendering<tyFilamentRenderStructure>` for an overview of the core types and their uses.
|
||||
|
||||
.. _mjrf_defaultContextConfig:
|
||||
|
||||
`mjrf_defaultContextConfig <#mjrf_defaultContextConfig>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultContextConfig
|
||||
|
||||
Initializes the mjrfContextConfig to default values.
|
||||
|
||||
.. _mjrf_createContext:
|
||||
|
||||
`mjrf_createContext <#mjrf_createContext>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_createContext
|
||||
|
||||
Creates a filament rendering context.
|
||||
|
||||
.. _mjrf_destroyContext:
|
||||
|
||||
`mjrf_destroyContext <#mjrf_destroyContext>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_destroyContext
|
||||
|
||||
Destroys the filament rendering context.
|
||||
|
||||
.. _mjrf_getRendererInfo:
|
||||
|
||||
`mjrf_getRendererInfo <#mjrf_getRendererInfo>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_getRendererInfo
|
||||
|
||||
Gets active renderer information for the given filament context.
|
||||
|
||||
.. _mjrf_defaultRenderRequest:
|
||||
|
||||
`mjrf_defaultRenderRequest <#mjrf_defaultRenderRequest>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultRenderRequest
|
||||
|
||||
Initializes the mjrfRenderRequest to default values.
|
||||
|
||||
.. _mjrf_defaultReadPixelsRequest:
|
||||
|
||||
`mjrf_defaultReadPixelsRequest <#mjrf_defaultReadPixelsRequest>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultReadPixelsRequest
|
||||
|
||||
Initializes the mjrfReadPixelsRequest to default values.
|
||||
|
||||
.. _mjrf_render:
|
||||
|
||||
`mjrf_render <#mjrf_render>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_render
|
||||
|
||||
Submits the given requests for rendering. Because rendering happens asynchronously, callers have
|
||||
to submit both the render and read requests in the same call. Multiple requests and reads can be
|
||||
submitted in a single call. These requests will be processed in order, so some care must be
|
||||
taken. Firstly, requests should be grouped by target. Next, the combined area of the viewports
|
||||
for all requests for a given target must be contained within the dimensions of the target itself.
|
||||
|
||||
Callbacks will be invoked from within this function, though there is no guarantee on which
|
||||
invocation of this function it will be done.
|
||||
|
||||
.. _mjrf_waitForFrame:
|
||||
|
||||
`mjrf_waitForFrame <#mjrf_waitForFrame>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_waitForFrame
|
||||
|
||||
Waits for all rendering operations to complete for the given frame handle, triggering any
|
||||
callbacks as needed.
|
||||
|
||||
.. _mjrf_setClearColor:
|
||||
|
||||
`mjrf_setClearColor <#mjrf_setClearColor>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setClearColor
|
||||
|
||||
Sets the clear color for the renderer.
|
||||
|
||||
.. _mjrf_defaultFrameStats:
|
||||
|
||||
`mjrf_defaultFrameStats <#mjrf_defaultFrameStats>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultFrameStats
|
||||
|
||||
Initializes the mjrFrameStats to default values.
|
||||
|
||||
.. _mjrf_getFrameStats:
|
||||
|
||||
`mjrf_getFrameStats <#mjrf_getFrameStats>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_getFrameStats
|
||||
|
||||
Returns the stats for the given frame but updating the given `stats_out`.
|
||||
|
||||
.. _mjrf_defaultTextureConfig:
|
||||
|
||||
`mjrf_defaultTextureConfig <#mjrf_defaultTextureConfig>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultTextureConfig
|
||||
|
||||
Initializes the mjrfTextureConfig to default values.
|
||||
|
||||
.. _mjrf_createTexture:
|
||||
|
||||
`mjrf_createTexture <#mjrf_createTexture>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_createTexture
|
||||
|
||||
Creates a filament texture. Note that the texture will not be created on the GPU until
|
||||
`mjrf_setTextureData()` is called.
|
||||
|
||||
.. _mjrf_destroyTexture:
|
||||
|
||||
`mjrf_destroyTexture <#mjrf_destroyTexture>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_destroyTexture
|
||||
|
||||
Destroys the texture.
|
||||
|
||||
.. _mjrf_defaultTextureData:
|
||||
|
||||
`mjrf_defaultTextureData <#mjrf_defaultTextureData>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultTextureData
|
||||
|
||||
Initializes the mjrfTextureData to default values.
|
||||
|
||||
.. _mjrf_setTextureData:
|
||||
|
||||
`mjrf_setTextureData <#mjrf_setTextureData>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setTextureData
|
||||
|
||||
Uploads the given texture data to the texture.
|
||||
|
||||
.. _mjrf_getTextureWidth:
|
||||
|
||||
`mjrf_getTextureWidth <#mjrf_getTextureWidth>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_getTextureWidth
|
||||
|
||||
Returns the width of the texture.
|
||||
|
||||
.. _mjrf_getTextureHeight:
|
||||
|
||||
`mjrf_getTextureHeight <#mjrf_getTextureHeight>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_getTextureHeight
|
||||
|
||||
Returns the height of the texture.
|
||||
|
||||
.. _mjrf_getTextureSamplerType:
|
||||
|
||||
`mjrf_getTextureSamplerType <#mjrf_getTextureSamplerType>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_getTextureSamplerType
|
||||
|
||||
Returns the sampler type (mjrSamplerType) used by the texture.
|
||||
[returns: mjrSamplerType]
|
||||
|
||||
.. _mjrf_defaultMeshData:
|
||||
|
||||
`mjrf_defaultMeshData <#mjrf_defaultMeshData>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultMeshData
|
||||
|
||||
Initializes the mjrfMeshData to default values.
|
||||
|
||||
.. _mjrf_createMesh:
|
||||
|
||||
`mjrf_createMesh <#mjrf_createMesh>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_createMesh
|
||||
|
||||
Creates a mesh with the given data.
|
||||
|
||||
.. _mjrf_destroyMesh:
|
||||
|
||||
`mjrf_destroyMesh <#mjrf_destroyMesh>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_destroyMesh
|
||||
|
||||
Destroys the mesh.
|
||||
|
||||
.. _mjrf_defaultSceneParams:
|
||||
|
||||
`mjrf_defaultSceneParams <#mjrf_defaultSceneParams>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultSceneParams
|
||||
|
||||
Initializes the mjrfSceneParams to default values.
|
||||
|
||||
.. _mjrf_createScene:
|
||||
|
||||
`mjrf_createScene <#mjrf_createScene>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_createScene
|
||||
|
||||
Creates a scene with the given parameters.
|
||||
|
||||
.. _mjrf_destroyScene:
|
||||
|
||||
`mjrf_destroyScene <#mjrf_destroyScene>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_destroyScene
|
||||
|
||||
Destroys the scene.
|
||||
|
||||
.. _mjrf_addLightToScene:
|
||||
|
||||
`mjrf_addLightToScene <#mjrf_addLightToScene>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_addLightToScene
|
||||
|
||||
Adds a light to the scene.
|
||||
|
||||
.. _mjrf_removeLightFromScene:
|
||||
|
||||
`mjrf_removeLightFromScene <#mjrf_removeLightFromScene>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_removeLightFromScene
|
||||
|
||||
Removes the light from the scene.
|
||||
|
||||
.. _mjrf_addRenderableToScene:
|
||||
|
||||
`mjrf_addRenderableToScene <#mjrf_addRenderableToScene>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_addRenderableToScene
|
||||
|
||||
Adds a renderable to the scene.
|
||||
|
||||
.. _mjrf_removeRenderableFromScene:
|
||||
|
||||
`mjrf_removeRenderableFromScene <#mjrf_removeRenderableFromScene>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_removeRenderableFromScene
|
||||
|
||||
Removes the renderable from the scene.
|
||||
|
||||
.. _mjrf_setSceneSkybox:
|
||||
|
||||
`mjrf_setSceneSkybox <#mjrf_setSceneSkybox>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setSceneSkybox
|
||||
|
||||
Sets the skybox (cube texture) for the scene.
|
||||
|
||||
.. _mjrf_configureSceneFromModel:
|
||||
|
||||
`mjrf_configureSceneFromModel <#mjrf_configureSceneFromModel>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_configureSceneFromModel
|
||||
|
||||
Configures the scene based on the parameters in an mjModel.
|
||||
|
||||
.. _mjrf_defaultLightParams:
|
||||
|
||||
`mjrf_defaultLightParams <#mjrf_defaultLightParams>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultLightParams
|
||||
|
||||
Initializes the mjrfLightParams to default values.
|
||||
|
||||
.. _mjrf_createLight:
|
||||
|
||||
`mjrf_createLight <#mjrf_createLight>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_createLight
|
||||
|
||||
Creates a light for the filament renderer.
|
||||
|
||||
.. _mjrf_destroyLight:
|
||||
|
||||
`mjrf_destroyLight <#mjrf_destroyLight>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_destroyLight
|
||||
|
||||
Destroys the light.
|
||||
|
||||
.. _mjrf_setLightEnabled:
|
||||
|
||||
`mjrf_setLightEnabled <#mjrf_setLightEnabled>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setLightEnabled
|
||||
|
||||
Enables or disables the light.
|
||||
|
||||
.. _mjrf_setLightIntensity:
|
||||
|
||||
`mjrf_setLightIntensity <#mjrf_setLightIntensity>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setLightIntensity
|
||||
|
||||
Sets the intensity of the light, in candela.
|
||||
|
||||
.. _mjrf_setLightColor:
|
||||
|
||||
`mjrf_setLightColor <#mjrf_setLightColor>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setLightColor
|
||||
|
||||
Sets the RGB color of the light.
|
||||
|
||||
.. _mjrf_setLightTransform:
|
||||
|
||||
`mjrf_setLightTransform <#mjrf_setLightTransform>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setLightTransform
|
||||
|
||||
Sets the position and direction of the light.
|
||||
|
||||
.. _mjrf_getLightType:
|
||||
|
||||
`mjrf_getLightType <#mjrf_getLightType>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_getLightType
|
||||
|
||||
Returns the type of the light (mjrLightType).
|
||||
|
||||
.. _mjrf_defaultMaterial:
|
||||
|
||||
`mjrf_defaultMaterial <#mjrf_defaultMaterial>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultMaterial
|
||||
|
||||
Initializes the mjrfMaterial to default values.
|
||||
|
||||
.. _mjrf_defaultRenderableParams:
|
||||
|
||||
`mjrf_defaultRenderableParams <#mjrf_defaultRenderableParams>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultRenderableParams
|
||||
|
||||
Initializes the mjrfRenderableParams to default values.
|
||||
|
||||
.. _mjrf_createRenderable:
|
||||
|
||||
`mjrf_createRenderable <#mjrf_createRenderable>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_createRenderable
|
||||
|
||||
Creates a renderable with the given parameters.
|
||||
|
||||
.. _mjrf_destroyRenderable:
|
||||
|
||||
`mjrf_destroyRenderable <#mjrf_destroyRenderable>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_destroyRenderable
|
||||
|
||||
Destroys the renderable.
|
||||
|
||||
.. _mjrf_setRenderableMesh:
|
||||
|
||||
`mjrf_setRenderableMesh <#mjrf_setRenderableMesh>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setRenderableMesh
|
||||
|
||||
Sets the mesh of the renderable.
|
||||
|
||||
.. _mjrf_setRenderableGeomMesh:
|
||||
|
||||
`mjrf_setRenderableGeomMesh <#mjrf_setRenderableGeomMesh>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setRenderableGeomMesh
|
||||
|
||||
Sets the mesh of the renderable to a built-in mesh based on the geom type. Note: using the same
|
||||
parameters (nstack, nslice, nquad) will have better performance as the internal mesh data can be
|
||||
shared across renderables.
|
||||
[type: mjtGeom]
|
||||
|
||||
.. _mjrf_setRenderableMaterial:
|
||||
|
||||
`mjrf_setRenderableMaterial <#mjrf_setRenderableMaterial>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setRenderableMaterial
|
||||
|
||||
Sets the material properties and textures of the renderable.
|
||||
|
||||
.. _mjrf_getRenderableMaterial:
|
||||
|
||||
`mjrf_getRenderableMaterial <#mjrf_getRenderableMaterial>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_getRenderableMaterial
|
||||
|
||||
Copies the material properties of the renderable into the given mjrfMaterial.
|
||||
|
||||
.. _mjrf_setRenderableTransform:
|
||||
|
||||
`mjrf_setRenderableTransform <#mjrf_setRenderableTransform>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setRenderableTransform
|
||||
|
||||
Sets the transform position and rotation of the renderable.
|
||||
|
||||
.. _mjrf_setRenderableSize:
|
||||
|
||||
`mjrf_setRenderableSize <#mjrf_setRenderableSize>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_setRenderableSize
|
||||
|
||||
Sets the size of the renderable. Note that, for most renderables, this is equivalent to setting
|
||||
the scale. However, for some geom-based renderables, the size scale is not applied uniformly
|
||||
(e.g. the spherical ends of a capsule are scaled such that they always remain spherical).
|
||||
|
||||
.. _mjrf_defaultRenderTargetConfig:
|
||||
|
||||
`mjrf_defaultRenderTargetConfig <#mjrf_defaultRenderTargetConfig>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_defaultRenderTargetConfig
|
||||
|
||||
Initializes the RenderTargetConfig to default values.
|
||||
|
||||
.. _mjrf_createRenderTarget:
|
||||
|
||||
`mjrf_createRenderTarget <#mjrf_createRenderTarget>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_createRenderTarget
|
||||
|
||||
Creates a render target for the filament renderer.
|
||||
|
||||
.. _mjrf_destroyRenderTarget:
|
||||
|
||||
`mjrf_destroyRenderTarget <#mjrf_destroyRenderTarget>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_destroyRenderTarget
|
||||
|
||||
Destroys the render target.
|
||||
|
||||
.. _mjrf_resizeRenderTarget:
|
||||
|
||||
`mjrf_resizeRenderTarget <#mjrf_resizeRenderTarget>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjrf_resizeRenderTarget
|
||||
|
||||
Resizes the render target to the given width and height.
|
||||
|
||||
.. _UIframework:
|
||||
|
||||
UI framework
|
||||
|
||||
@@ -434,6 +434,11 @@ The functions in this section implement abstract visualization. The results are
|
||||
also be used by users wishing to implement their own renderer, or hook up MuJoCo to advanced rendering tools such as
|
||||
Unity or Unreal Engine. See :ref:`simulate<saSimulate>` for illustration of how to use these functions.
|
||||
|
||||
.. _FilamentRenderingApi:
|
||||
|
||||
Rendering functions using the Filament rendering engine. These functions are prefixed with ``mjrf``. See
|
||||
:ref:`Filament Rendering<tyFilamentRenderStructure>` for an overview of the core types and their uses.
|
||||
|
||||
.. _OpenGLrendering:
|
||||
|
||||
These functions expose the OpenGL renderer. See :ref:`simulate<saSimulate>` for an illustration
|
||||
|
||||
Reference in New Issue
Block a user