Default implementation of the IMaterial interface.
sealed class
|
Material
|
implements
|
IMaterial
|
The configurator object for this type.
public
static
property
|
Config
{
get
}
|
||
type
|
IConfigurator<IMaterial>
|
||
value
|
|
The configurator object. |
Returns the configuration value that describes this object.
public
method
|
ToConfig
()
|
||
type
|
ConfigValue
|
||
returns
|
|
The configuration value. | |
implements
|
IConfigurable.ToConfig
|
Remarks:
All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.
The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.
Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.
The albedo color and material transparency.
public
property
|
Albedo
{
get
set
}
|
||
type
|
ColorF
|
||
value
|
The albedo color value (linear sRGB). | ||
implements
|
IMaterial.Albedo
|
Remarks:
The red, green and blue channels define the albedo color (R, G and B). The alpha channel holds the material transparency (A).
Defaults to White.
Albedo texture map, will be modulated with Albedo.
public
property
|
AlbedoMap
{
get
set
}
|
||
type
|
IModelTexture
|
||
value
|
The
albedo
texture
(compressed
sRGB)
or
null . |
||
implements
|
IMaterial.AlbedoMap
|
The maximum displacement.
public
property
|
Displacement
{
get
set
}
|
||
type
|
float32
|
||
value
|
|
The maximum displacement, in model-space. | |
implements
|
IMaterial.Displacement
|
The displacement map.
public
property
|
DisplacementMap
{
get
set
}
|
||
type
|
IModelTexture
|
||
value
|
The
displacement
texture
(linear)
or
null . |
||
implements
|
IMaterial.DisplacementMap
|
Remarks:
Displacement values are read from the red channel; all other channels are ignored.
The emissive color.
public
property
|
Emissive
{
get
set
}
|
||
type
|
ColorF
|
||
value
|
The emissive color value (linear sRGB). | ||
implements
|
IMaterial.Emissive
|
Remarks:
The red, green and blue channels define the emissive color (R, G and B). The alpha channel is ignored ( A).
Defaults to Black.
Emissive texture map, will be modulated with Emissive.
public
property
|
EmissiveMap
{
get
set
}
|
||
type
|
IModelTexture
|
||
value
|
The
emissive
texture
(compressed
sRGB)
or
null . |
||
implements
|
IMaterial.EmissiveMap
|
The material gloss.
public
property
|
Gloss
{
get
set
}
|
||
type
|
float32
|
||
value
|
The gloss value (linear), in the range [0..1]. | ||
implements
|
IMaterial.Gloss
|
Remarks:
Gloss
is
defined
as
microsurface
smoothness:
a
value
of
1
means
that
the
surface
is
smooth
(reflections
will
appear
bright
and
crisp),
a
value
of
0
means
that
the
surface
is
rough
(reflections
will
appear
dim
and
blurry).
Defaults
to
0.1
.
The gloss texture map, will be modulated with Gloss.
public
property
|
GlossMap
{
get
set
}
|
||
type
|
IModelTexture
|
||
value
|
The
gloss
texture
(linear)
or
null . |
||
implements
|
IMaterial.GlossMap
|
Remarks:
Gloss values are read from the red channel; all other channels are ignored.
Is this material transparent?
public
property
|
IsTransparent
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
material
is
transparent,
false
if
it
is
opaque. |
||
implements
|
IMaterial.IsTransparent
|
Remarks:
A material is considered to be transparent if it can produce semi-transparent pixels (i.e. normalized alpha values greater than 0 and less than 1).
Normal texture map.
public
property
|
NormalMap
{
get
set
}
|
||
type
|
IModelTexture
|
||
value
|
The
normal
texture
(linear
sRGB)
or
null . |
||
implements
|
IMaterial.NormalMap
|
Remarks:
The red, green and blue channels define the tangent-space normal vector (not necessarily of unit length). The alpha channel is ignored.
The relative pixel intensities (red, green, blue) in the range [0..1] are mapped to the unit cube:
red :[0..1] => X:[-1 .. +1] green:[0..1] => Y:[-1 .. +1] blue :[0..1] => Z:[-1 .. +1]where
X+
is
the
tangent
direction
(positive
texture
U-axis),
Y+
is
the
bitangent
direction
(positive
texture
V-axis)
and
Z+
is
direction
of
the
surface
normal
vector.
Ambient occlusion map.
public
property
|
OcclusionMap
{
get
set
}
|
||
type
|
IModelTexture
|
||
value
|
The
ambient
occlusion
texture
(linear)
or
null . |
||
implements
|
IMaterial.OcclusionMap
|
Remarks:
Ambient lighting is modulated with the ambient occlusion values read from the occlusion map.
Ambient occlusion values are read from the red channel; all other channels are ignored.
Opacity map.
public
property
|
OpacityMap
{
get
set
}
|
||
type
|
IModelTexture
|
||
value
|
The
opacity
texture
(linear)
or
null . |
||
implements
|
IMaterial.OpacityMap
|
Remarks:
Material transparency (i.e. the alpha channel of Albedo and AlbedoMap) is modulated with the opacity values read from the opacity map.
Opacity values are taken from the red channel; all other channels are ignored.
The reflectivity value.
public
property
|
Reflectivity
{
get
set
}
|
||
type
|
ColorF
|
||
value
|
The reflectivity color value (linear sRGB). | ||
implements
|
IMaterial.Reflectivity
|
Remarks:
The red, green and blue channels define the reflectivity color and intensity of the material (R, G and B). The alpha channel is ignored (A).
Defaults
to
(0.1,
0.1,
0.1)
.
Reflectivity texture map, will be modulated with Reflectivity.
public
property
|
ReflectivityMap
{
get
set
}
|
||
type
|
IModelTexture
|
||
value
|
The
reflectivity
texture
(compressed
sRGB)
or
null . |
||
implements
|
IMaterial.ReflectivityMap
|
The translucency value.
public
property
|
Translucency
{
get
set
}
|
||
type
|
ColorF
|
||
value
|
The translucency color value (linear sRGB). | ||
implements
|
IMaterial.Translucency
|
Remarks:
The red, green and blue channels define the translucency of the material when backlit ( R, G and B). The alpha channel is ignored (A).
Defaults to Black.
Translucency texture map, will be modulated with Translucency.
public
property
|
TranslucencyMap
{
get
set
}
|
||
type
|
IModelTexture
|
||
value
|
The
translucency
texture
(compressed
sRGB)
or
null . |
||
implements
|
IMaterial.TranslucencyMap
|
Creates a new instance of Material.
public
constructor
|
Material
(IMaterial other = null)
|
||
params
|
other
|
The
material
to
copy
from.
If
null ,
a
default
material
is
created.
Defaults
to
null .
|
public
constructor
|
Material
(IModelTexture albedo)
|
||
params
|
albedo
|
public
constructor
|
Material
(int64 albedo,
IModelTexture albedoMap = null)
|
||
params
|
albedo
|
||
albedoMap
|
public
constructor
|
Material
(ColorF albedo,
IModelTexture albedoMap = null)
|
||
params
|
albedo
|
||
albedoMap
|
Compares this object with the given one.
[Pure]
|
||||
public
method
|
Equals
(IMaterial other)
|
|||
type
|
bool
|
|||
params
|
other
|
The object to compare to. | ||
returns
|
true
if
this
object
is
equal
to
other,
false
if
not.
|
|||
implements
|
IEquatable.Equals
|