TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

interface IMaterial in Tinman.Engine.Models

Base interface for classes that describe materials of 3D models.

interface IMaterial extends IConfigurable
  IEquatable<IMaterial>
  base of Material

Remarks

Materials use a specular / glossiness PBR workflow, as described here:
https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md

Attributes

Albedo

The albedo color and material transparency.

property Albedo { get }
type ColorF
value The albedo color value (linear sRGB).

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.

AlbedoMap

Albedo texture map, will be modulated with Albedo.

property AlbedoMap { get }
type IModelTexture
value The albedo texture (compressed sRGB) or null.

Displacement

The maximum displacement.

property Displacement { get }
type float32
value [>=0] The maximum displacement, in model-space.

DisplacementMap

The displacement map.

property DisplacementMap { get }
type IModelTexture
value The displacement texture (linear) or null.

Remarks:

Displacement values are read from the red channel; all other channels are ignored.

The red pixel intensity in the range [0..1] is mapped to the displacement values amount in the range [-<see cref="Displacement"/>.. <see cref="Displacement"/>]. Thus, a pixel intensity of 0.5 will result in zero displacement.

Emissive

The emissive color.

property Emissive { get }
type ColorF
value The emissive color value (linear sRGB).

Remarks:

The red, green and blue channels define the emissive color (R, G and B). The alpha channel is ignored ( A).

Defaults to Black.

EmissiveMap

Emissive texture map, will be modulated with Emissive.

property EmissiveMap { get }
type IModelTexture
value The emissive texture (compressed sRGB) or null.

Gloss

The material gloss.

property Gloss { get }
type float32
value The gloss value (linear), in the range [0..1].

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.

GlossMap

The gloss texture map, will be modulated with Gloss.

property GlossMap { get }
type IModelTexture
value The gloss texture (linear) or null.

Remarks:

Gloss values are read from the red channel; all other channels are ignored.

IsTransparent

Is this material transparent?

property IsTransparent { get }
type bool
value true if this material is transparent, false if it is opaque.

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).

NormalMap

Normal texture map.

property NormalMap { get }
type IModelTexture
value The normal texture (linear sRGB) or null.

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.

OcclusionMap

Ambient occlusion map.

property OcclusionMap { get }
type IModelTexture
value The ambient occlusion texture (linear) or null.

Remarks:

Ambient lighting is modulated with the ambient occlusion values read from the occlusion map, i.e. an ambient occlusion value of 1 will result in full ambient lighting whereas a value of 0 will result in zero ambient lighting.

Ambient occlusion values are read from the red channel; all other channels are ignored.

OpacityMap

Opacity map.

property OpacityMap { get }
type IModelTexture
value The opacity texture (linear) or null.

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.

Reflectivity

The reflectivity value.

property Reflectivity { get }
type ColorF
value The reflectivity color value (linear sRGB).

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.04, 0.04, 0.04).

ReflectivityMap

Reflectivity texture map, will be modulated with Reflectivity.

property ReflectivityMap { get }
type IModelTexture
value The reflectivity texture (compressed sRGB) or null.

Translucency

The translucency value.

property Translucency { get }
type ColorF
value The translucency color value (linear sRGB).

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.

TranslucencyMap

Translucency texture map, will be modulated with Translucency.

property TranslucencyMap { get }
type IModelTexture
value The translucency texture (compressed sRGB) or null.

Methods

Equals

Compares this object with the given one.

[Pure]
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.
inherited IEquatable.Equals

ToConfig

Returns the configuration value that describes this object.

method ToConfig ()
type ConfigValue
returns [not-null] The configuration value.
inherited 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.

Exceptions: