This is the documentation for Enlighten.

.mats format


The XML schema for the .mats file format is available in Src/Samples/Libraries/GeoEn2Support/common_mats.xsd.

There are two types of material: Blinn-Phong and PBR. Some elements and attributes are common to both types.

Blinn-Phong Materials

<materials>

Your materials must be enclosed within a single <materials> element, with the following attributes. Your <materials> element may contain any number of <material> elements describing the IDs/GUIDs and behaviour of individual materials.

Attribute

Usage

Description

Values

version

Required

The version of the .mats file format.

Integer

<material>

The <material> element is used to assign material IDs/GUIDs and describe the behaviour of individual materials. Any number of <material> elements may appear within your <materials> element.

<diffuse>

The <diffuse> element is used to specify the diffuse channel as a single colour or a texture.

Attribute

Usage

Description

Values

colour

Optional

Specifies the colour of the diffuse channel.

4-element vector as string (RGBA)

scale

Optional

The scale to apply to the diffuse channel.

Float

uvScale

Optional

The scale to apply to the mesh's UVs before looking up in the diffuse texture.

2-element vector as string (XY scale)

uvOffset

Optional

The offset to apply to the mesh's UVs before looking up in the diffuse texture (applied after the above uvScale).

2-element vector as string (XY scale)

The <diffuse> element can optionally contain a child <texture> element, containing the filename of the texture to use.

<opacity>

The <opacity> element is used to specify the opacity channel as a single colour or a texture.

Attribute

Usage

Description

Values

colour

Optional

Specifies the colour of the opacity channel.

4-element vector as string (RGBA)

scale

Optional

The scale to apply to the opacity channel.

Float

uvScale

Optional

The scale to apply to the mesh's UVs before looking up in the opacity texture.

2-element vector as string (XY scale)

uvOffset

Optional

The offset to apply to the mesh's UVs before looking up in the opacity texture (applied after the above uvScale).

2-element vector as string (XY scale)

<specular>

The <specular> element is used to specify the specular channel as a single colour or a texture, along with a power.

Attribute

Usage

Description

Values

colour

Optional

Specifies the colour of the opacity channel.

4-element vector as string (RGBA)

scale

Optional

The scale to apply to the opacity channel.

Float

power

Required

A power to apply to the specular channel.

Float

uvScale

Optional

The scale to apply to the mesh's UVs before looking up in the specular texture.

2-element vector as string (XY scale)

uvOffset

Optional

The offset to apply to the mesh's UVs before looking up in the specular texture (applied after the above uvScale).

2-element vector as string (XY scale)

The <specular> element can optionally contain a child <texture> element, containing the filename of the texture to use.

PBR Materials

<pbrMaterials>

Your materials must be enclosed within a single <pbrMaterials> element, with the following attributes. Your <pbrMaterials> element may contain any number of <pbrMaterial> elements describing the IDs/GUIDs and behaviour of individual materials.

Attribute

Usage

Description

Values

version

Required

The version of the .mats file format.

Integer

<pbrMaterial>

The <pbrMaterial> element is used to assign material IDs/GUIDs and describe the behaviour of individual materials. Any number of <pbrMaterial> elements may appear within your <pbrMaterials> element.

<baseColour>

The <baseColour> element is used to specify the baseColour channel as a colour and/or a texture.

Attribute

Usage

Description

Values

colour

Optional

Specifies the colour of the baseColour channel.

4-element vector as string (RGBA)

scale

Optional

The scale to apply to the baseColour channel.

Float

uvScale

Optional

The scale to apply to the mesh's UVs before looking up in the baseColour texture.

2-element vector as string (XY scale)

uvOffset

Optional

The offset to apply to the mesh's UVs before looking up in the baseColour texture (applied after the above uvScale).

2-element vector as string (XY scale)

The <baseColour> element can optionally contain a child <texture> element, containing the filename of the texture to use.

<metallic>

The <metallic> element is used to specify the metallic channel as a single channel texture.

Attribute

Usage

Description

Values

scale

Optional

The scale to apply to the metallic channel.

Float

uvScale

Optional

The scale to apply to the mesh's UVs before looking up in the metallic texture.

2-element vector as string (XY scale)

uvOffset

Optional

The offset to apply to the mesh's UVs before looking up in the metallic texture (applied after the above uvScale).

2-element vector as string (XY scale)

The <metallic> element must contain a child <texture> element, containing the filename of the texture to use.

<roughness>

The <roughness> element is used to specify the roughness channel as a single channel texture.

Attribute

Usage

Description

Values

scale

Optional

The scale to apply to the roughness channel.

Float

uvScale

Optional

The scale to apply to the mesh's UVs before looking up in the roughness texture.

2-element vector as string (XY scale)

uvOffset

Optional

The offset to apply to the mesh's UVs before looking up in the roughness texture (applied after the above uvScale).

2-element vector as string (XY scale)

The <roughness> element must contain a child <texture> element, containing the filename of the texture to use.

<ao>

The <ao> element is used to specify the ao channel as a single channel texture.

Attribute

Usage

Description

Values

diffuseScale

Optional

The scale to apply to the ao channel when applied to indirect diffuse lighting.

Float

specularScale

Optional

The scale to apply to the ao channel when applied to indirect specular lighting.

Float

uvScale

Optional

The scale to apply to the mesh's UVs before looking up in the ao texture.

2-element vector as string (XY scale)

uvOffset

Optional

The offset to apply to the mesh's UVs before looking up in the ao texture (applied after the above uvScale).

2-element vector as string (XY scale)

The <ao> element must contain a child <texture> element, containing the filename of the texture to use.

<cavity>

The <cavity> element is used to specify the cavity channel as a single channel texture.

Attribute

Usage

Description

Values

scale

Optional

The scale to apply to the cavity channel.

Float

uvScale

Optional

The scale to apply to the mesh's UVs before looking up in the cavity texture.

2-element vector as string (XY scale)

uvOffset

Optional

The offset to apply to the mesh's UVs before looking up in the cavity texture (applied after the above uvScale).

2-element vector as string (XY scale)

The <cavity> element must contain a child <texture> element, containing the filename of the texture to use.

Common

The atttributes and child elements listed below are common to both <material> and <pbrMaterial> elements:

Attribute

Usage

Description

Values

id

Required

The identifier of this material. 

String 

guid 

Optional 

The GUID of this material. 

GUID string 

backfaceBehaviourType

Optional

The backface ray hit behaviour type of this material.

String: 
invalid 
black 
transparent 
doubleSided

shadowfaceBehaviourType

Optional

Defines the triangle faces which cast direct lighting shadows. Used in precomputed directional visibility and baking. Note that the precompute treats bothWithInvalidBackas back.

String: 
front 
back 
both 
bothWithInvalidBack

indirectTransparency

Optional

Fraction of incident rays which pass through the material.

Positive float 
(default 0.0)

indirectReflectivity

Optional

The fraction of incident rays which are reflected by the material.

Positive float 
(default 1.0)

isEmissive

Optional

Setting to true will enable special treatment appropriate for emissive materials. 

Boolean 
(default false)

<normal>

The <normal> element is used to specify the normal channel as a texture.

Attribute

Usage

Description

Values

scale

Optional

The scale to apply to the normal channel.

Float

useForBaking

Optional

Whether the normal channel should be used when baking.

Boolean

uvScale

Optional

The scale to apply to the mesh's UVs before looking up in the normal texture.

2-element vector as string (XY scale)

uvOffset

Optional

The offset to apply to the mesh's UVs before looking up in the normal texture (applied after the above uvScale).

2-element vector as string (XY scale)

The <normal> element must contain a child <texture> element, containing the filename of the texture to use.

<emissive>

The <emissive> element is used to specify the emissive channel as a single colour or a texture.

Attribute

Usage

Description

Values

colour

Optional

Specifies the colour of the emissive channel.

4-element vector as string (RGBA)

scale

Optional

The scale to apply to the emissive channel.

Float

uvScale

Optional

The scale to apply to the mesh's UVs before looking up in the emissive texture.

2-element vector as string (XY scale)

uvOffset

Optional

The offset to apply to the mesh's UVs before looking up in the emissive texture (applied after the above uvScale).

2-element vector as string (XY scale)

The <emissive> element can optionally contain a child <texture> element, containing the filename of the texture to use.

<transparency>

The <transparency> element is used to specify the transparency channel as a single colour or a texture.

Attribute

Usage

Description

Values

colour

Optional

Specifies the colour of the transparency channel.

4-element vector as string (RGBA)

scale

Optional

The scale to apply to the transparency channel.

Float

uvScale

Optional

The scale to apply to the mesh's UVs before looking up in the transparency texture.

2-element vector as string (XY scale)

uvOffset

Optional

The offset to apply to the mesh's UVs before looking up in the transparency texture (applied after the above uvScale).

2-element vector as string (XY scale)

The <transparency> element can optionally contain a child <texture> element, containing the filename of the texture to use.