Class Material
Specifies the appearance of a surface in the 3D graphics.
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public class Material
Constructors
Material()
Creates a new Material with a default (gray) color.
Declaration
public Material()
Material(Texture)
Creates a new Material with the given texture.
Declaration
public Material(Texture baseTexture)
Parameters
Type | Name | Description |
---|---|---|
Texture | baseTexture |
Material(Color)
Creates a new Material with the given color.
Declaration
public Material(Color simpleColor)
Parameters
Type | Name | Description |
---|---|---|
Color | simpleColor |
Material(Color, Color, Color, Color, Int32)
Creates a new Material with the given color parameters
Declaration
public Material(Color ambient, Color diffuse, Color specular, Color emissive, int shininess)
Parameters
Type | Name | Description |
---|---|---|
Color | ambient | Ambient color component. See Ambient. |
Color | diffuse | Diffuse color component. See Diffuse. |
Color | specular | Specular color component. See Specular. |
Color | emissive | Emissive color component. See Emissive. |
Int32 | shininess | Sets the shininess value. See Shininess. |
Fields
Empty
An empty material.
Declaration
public static readonly Material Empty
Field Value
Type | Description |
---|---|
Material |
Properties
Ambient
Gets or sets the ambient color component. The ambient color is applied uniformly to an object regardless of light and view direction.
Declaration
public Color Ambient { get; set; }
Property Value
Type | Description |
---|---|
Color |
BaseTexture
Gets or sets the base color texture.
Declaration
public Texture BaseTexture { get; set; }
Property Value
Type | Description |
---|---|
Texture |
Blend
Gets or sets whether the result of the color properties (ambient, diffuse, specular, emissive, shininess) should be blended with the texture-based effects.
Declaration
olete("Use BlendMode instead")]
public bool Blend { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
BlendMode
Gets or sets how the result of the color properties (ambient, diffuse, specular, emissive, shininess) should be blended with the texture-based effects.
Declaration
public BlendMode BlendMode { get; set; }
Property Value
Type | Description |
---|---|
BlendMode |
Diffuse
Gets or sets the diffuse color component. The diffuse color represents the light reflected from a matte surface.
Declaration
public Color Diffuse { get; set; }
Property Value
Type | Description |
---|---|
Color |
Effect
Declaration
olete("No longer supported")]
public MaterialEffect Effect { get; set; }
Property Value
Type | Description |
---|---|
MaterialEffect |
Emissive
Gets or sets the emissive color component. It behaves similar to the ambient color, except it is independent of the color of the light source.
Declaration
public Color Emissive { get; set; }
Property Value
Type | Description |
---|---|
Color |
EnvironmentMap
Gets or sets the environment map texture. The environment map is used to simulate a reflective surface. The texture in the environment map will be reflected by the surface it is applied to.
Declaration
public Texture EnvironmentMap { get; set; }
Property Value
Type | Description |
---|---|
Texture |
Remarks
Both sphere and cube map textures are supported. Requires advanced lighting.
IsEmpty
Returns true if this material is empty.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
Boolean |
NormalMap
Gets or sets the normal map texture. The normal map contains perturbations of the surface normal encoded as RGB values. It is used by the various bump mapping effects.
Declaration
public Texture NormalMap { get; set; }
Property Value
Type | Description |
---|---|
Texture |
Remarks
Requires advanced lighting.
Shininess
Gets or sets the coefficent for specular lighting. It affects the tightness of the specular highlight. The value has to be between 0 and 128. The default value is 30.
Declaration
public int Shininess { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Specular
Gets or sets the specular color component. The specular color represents the shiny effect resulting from a reflective surface.
Declaration
public Color Specular { get; set; }
Property Value
Type | Description |
---|---|
Color |
TextureLuminosity
Gets or sets the luminosity of the base texture, which defines how the texture is lighted.
Declaration
public float TextureLuminosity { get; set; }
Property Value
Type | Description |
---|---|
Single |
Remarks
A value of 0 (default) means that the texture brightness is defined only by the diffuse lighting of the surface, while 1 means the texture is entirely luminous. If BlendMode is Modulate, this property is ignored.
TextureMatrix
Specifies and offset and rotation for the textures
Declaration
public Matrix4 TextureMatrix { get; set; }
Property Value
Type | Description |
---|---|
Matrix4 |
TextureSize
Gets or sets a desired width and height, in meters, of the base texture and normal map when applied to a surface.
Declaration
public SizeF TextureSize { get; set; }
Property Value
Type | Description |
---|---|
SizeF |
Remarks
If TextureSize is nonzero, the texture coordinates of the surface will be modified when this Material is applied. TBD: Limitations
Methods
Clone()
Creates a copy of this Material.
Declaration
public Material Clone()
Returns
Type | Description |
---|---|
Material |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
GetSimpleColor()
Gets the basic color from the material.
Declaration
public Color GetSimpleColor()
Returns
Type | Description |
---|---|
Color |
SetSimpleColor(Color)
Sets the basic color and automatically calculate material properties like specular color, diffuse color etc.
Declaration
public void SetSimpleColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color |
SrgbToLinear(Byte)
Converts an sRGB color value to linear
Declaration
public static double SrgbToLinear(byte srgbColor)
Parameters
Type | Name | Description |
---|---|---|
Byte | srgbColor |
Returns
Type | Description |
---|---|
Double |