Material#
- class blueprints.Material[source]#
Bases:
MaterialType,NodeThingMaterials can be given to visual Things to specify their reflective properties for the renderer. To apply
Texturesto 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 toSitesandGeomswill have no visual effect.Most attribute descriptions are partially taken from Mujoco.
Attributes Summary
The
Assetof the MaterialThe color of the Material if set will be multiplied by the Things Color and Texture.
If set positive, the Material emitts lights.
This attribute corresponds to uniform metallicity coefficient applied to the entire material.
This attribute should be in the range [0 1].
This attribute corresponds to uniform roughness coefficient applied to the entire material.
Shininess in OpenGL.
Specularity in OpenGL.
The number of repetitions of the Texture in two directions
Referencing the material from a Thing will cause the texture to be applied to that Thing.
For
BoxTextures, this attribute controls how cube mapping is applied.Attributes Documentation
- asset#
The
Assetof the Material- Return type:
blue.MaterialAssetType
- color#
The color of the Material if set will be multiplied by the Things Color and Texture.
- Return type:
blue.ThingType
- emission#
If set positive, the Material emitts lights.
- Return type:
float
- metallic#
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
- reflectance#
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
- roughness#
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
- shininess#
Shininess in OpenGL.
- Return type:
float
- specular#
Specularity in OpenGL. This value should be in the range [0 1].
- Return type:
float
- texrepeat#
The number of repetitions of the Texture in two directions
- Return type:
np.ndarray
- texture#
Referencing the material from a Thing will cause the texture to be applied to that Thing.
- Return type:
blue.TextureType
- texuniform#
For
BoxTextures, this attribute controls how cube mapping is applied. The default valueFalsemeans 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 2DPlaneTextureis repeated N times over one spatial unit, regardless of object size.- Return type:
bool
- __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) – ATextureThingtexrepeat (
list [ int | float ] | np.ndarray, optional) – The number of repetitions of the Texture in two directionstexuniform (
bool, optional) – ForBoxTextures, 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 OpenGLreflectance (
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 Materialasset (
blue.MaterialAssetType | None, optional) – TheAssetof the Materialcopy (
bool, optional) – Dummy argument without effect
- classmethod __new__(*args, **kwargs)#