blueprints.material module#

class blueprints.material.Material[source]#

Bases: MaterialType, NodeThing

Materials can be given to visual Things to specify their reflective properties for the renderer. To apply Textures to Things, they must be attributes of a Material which in turn is assigned to the Thing. Just keeping the default values for Materials and assigning it to Sites and Geoms will have no visual effect.

Most attribute descriptions are partially taken from Mujoco.

__init__(texture=None, texrepeat=[1, 1], texuniform=False, emission=0.0, specular=0.5, shininess=0.5, reflectance=0.0, metallic=-1.0, roughness=-1.0, color=None, name=None, asset=None, copy=False)[source]#
Parameters:
  • texture (blue.TextureType | None, optional) – A Texture Thing

  • texrepeat (list [ int | float ] | np.ndarray, optional) – The number of repetitions of the Texture in two directions

  • texuniform (bool, optional) – For BoxTextures, this attribute controls how cube mapping is applied.

  • emission (int | float, optional) – If set positive, the Material emitts lights.

  • specular (int | float, optional) – Specularity in OpenGL. This value should be in the range [0 1].

  • shininess (int | float, optional) – Shininess in OpenGL

  • reflectance (int | float, optional) – Reflectance is computed without ray-tracing, so only a single reflection level is rendered.

  • metallic (int | float, optional) – This attribute is ignored by the default mujoco renderer.

  • roughness (int | float, optional) – This attribute is ignored by the default mujoco renderer.

  • color (str|object | None, optional) – The color of the Material (if set) will be multiplied with the Things color and (if set) the Materials Texture.

  • name (str | None, optional) – Name of the Material

  • asset (blue.MaterialAssetType | None, optional) – The Asset of the Material

  • copy (bool, optional) – Dummy argument without effect

property asset: MaterialAssetType#

The Asset of the Material

Return type:

blue.MaterialAssetType

property texrepeat: ndarray#

The number of repetitions of the Texture in two directions

Return type:

np.ndarray

property texuniform: bool#

For BoxTextures, this attribute controls how cube mapping is applied. The default value False means apply cube mapping directly, using the actual size of the object. The value “true” maps the texture to a unit object before scaling it to its actual size (geometric primitives are created by the renderer as unit objects and then scaled). In some cases this leads to more uniform texture appearance, but in general, which settings produces better results depends on the texture and the object. For 2d textures, this attribute interacts with texrepeat above. Let texrepeat be N. The default value “false” means that the 2d texture is repeated N times over the (z-facing side of the) object. The value “true” means that the 2D PlaneTexture is repeated N times over one spatial unit, regardless of object size.

Return type:

bool

property emission: float#

If set positive, the Material emitts lights.

Return type:

float

property specular: float#

Specularity in OpenGL. This value should be in the range [0 1].

Return type:

float

property shininess: float#

Shininess in OpenGL.

Return type:

float

property reflectance: float#

This attribute should be in the range [0 1]. If the value is greater than 0, and the material is applied to a plane or a box geom, the renderer will simulate reflectance. The larger the value, the stronger the reflectance. For boxes, only the face in the direction of the local +Z axis is reflective. Simulating reflectance properly requires ray-tracing which cannot (yet) be done in real-time. We are using the stencil buffer and suitable projections instead. Only the first reflective geom in the model is rendered as such. This adds one extra rendering pass through all geoms, in addition to the extra rendering pass added by each shadow-casting light.

Return type:

float

property metallic: float#

This attribute corresponds to uniform metallicity coefficient applied to the entire material. This attribute has no effect in MuJoCo’s native renderer, but it can be useful when rendering scenes with a physically-based renderer. In this case, if a non-negative value is specified, this metallic value should be multiplied by the metallic texture sampled value to obtain the final metallicity of the material.

Return type:

float

property roughness: float#

This attribute corresponds to uniform roughness coefficient applied to the entire material. This attribute has no effect in MuJoCo’s native renderer, but it can be useful when rendering scenes with a physically-based renderer. In this case, if a non-negative value is specified, this roughness value should be multiplied by the roughness texture sampled value to obtain the final roughness of the material.

Return type:

float

property color: ColorType#

The color of the Material if set will be multiplied by the Things Color and Texture.

Return type:

blue.ThingType

property texture: TextureType#

Referencing the material from a Thing will cause the texture to be applied to that Thing.

Return type:

blue.TextureType