Material

Description

sealed class Tinman.Engine.Models.Material

Derived from

IMaterial

Default implementation of the IMaterial interface.

Public / Constants

Refraction​Air


public constant RefractionAir → (1:float32)

Index of refraction of air.

Refraction​Default


public constant RefractionDefault → (1.5:float32)

The default index of refraction.

Refraction​Diamond


public constant RefractionDiamond → (2.42:float32)

Index of refraction of diamond.

Refraction​Eyes


public constant RefractionEyes → (1.38:float32)

Index of refraction of eyes.

Refraction​Sapphire


public constant RefractionSapphire → (1.76:float32)

Index of refraction of sapphire.

Refraction​Water


public constant RefractionWater → (1.33:float32)

Index of refraction of water.

Refraction​Window​Glass


public constant RefractionWindowGlass → (1.52:float32)

Index of refraction of window glass.

Public / Constructors

Material


public constructor Material → ()

Creates a new instance of Material using default values.

Texture

2 overloads


[Pure]
public static method Texture1 → (2)

baseColor in : int64

The initial MaterialPart.Value for IMaterial.BaseColor.

baseMap in : IModelTexture

The initial IMaterialPart.Map for IMaterial.BaseColor.

returns → Material

The created material.

Creates a material with a base color texture.


[Pure]
public static method Texture2 → (2)

baseColor in : ColorF

The initial MaterialPart.Value for IMaterial.BaseColor.

baseMap in : IModelTexture

The initial IMaterialPart.Map for IMaterial.BaseColor.

returns → Material

The created material.

Creates a material with a base color texture.

Uniform

2 overloads


[Pure]
public static method Uniform1 → (2)

baseColor in : int64

The initial MaterialPart.Value for IMaterial.BaseColor.

lineThickness opt : float32 = 1

The initial value for LineThickness

returns → Material

The created material.

Creates a material with a uniform color and optional line thickness.


[Pure]
public static method Uniform2 → (2)

baseColor in : ColorF

The initial MaterialPart.Value for IMaterial.BaseColor.

lineThickness opt : float32 = 1

The initial value for LineThickness

returns → Material

The created material.

Creates a material with a uniform color and optional line thickness.

Public / Methods

Phong


public method Phong → (6)

useMetallicRoughness in : bool

Chooses the PBR workflow: metallic-roughness (true) or specular-glossiness ( false).

ambient in : ColorF

The ambient color.

diffuse in : ColorF

The diffuse color.

specular in : ColorF

The specular color.

shininess in : float32

The specular exponent.

opacity opt : float32 = 1

The opacity.

returns → Material

this.

Computes the material values IMaterial.BaseColor, IMaterial.Metalness, IMaterial.Roughness and IMaterial.Reflectivity, based on the given Phong lighting coefficients.

This method uses the formulae described in:
Material mapping for model formats
https://learn.microsoft.com/en-us/azure/remote-rendering/reference/material-mapping

Reflectivity​Default


[Pure]
public static method ReflectivityDefault → (1)

indexOfRefraction opt : float32 = Material.RefractionDefault

The index of refraction.

returns → float32

The linear intensity of the pure-white diffuse reflectivity.

Computes the pure-white diffuse reflectivity for the given index of refraction.

Reflectivity​Default​Color


[Pure]
public static method ReflectivityDefaultColor → (1)

indexOfRefraction opt : float32 = Material.RefractionDefault

The index of refraction.

returns → ColorF

The pure-white diffuse reflectivity.

Computes the pure-white diffuse reflectivity for the given index of refraction.

Public / Attributes

Line​Thickness


public attribute LineThickness → (get,set)

value : float32

The line thickness for opaque line geometry, in screen pixels. Will be clamped to the supported range (see remarks).

The thickness to use for opaque line geometry.

At render time, the ILineFeatureLevels.FeatureLevel of the graphics context will be used to clamp the line thickness to the supported range.

Defaults to 1.

Refraction


public attribute Refraction → (get,set)

value : float32

The index of refraction.

The index of refraction.

Configuration

Config


public static attribute Config → (get)

value : IConfigurator<IMaterial>

[not-null]
The configurator object.

The configurator object for this type.