Skip to main content
Version: 0.12.0 (latest)

UeMtlLoader

A .mtl material file loader, designed to work with UeObjLoader.

Parses standard MTL directives and builds UeMeshStandardMaterial instances, loading any associated textures.

Constructor​

new UeMtlLoader()

Methods​

Method SignatureDescription
load(fname)Loads and parses the specified .mtl file. Returns a struct of materials.

Supported .mtl Directives​

DirectiveDescription
newmtlStarts a new material definition
KaAmbient color (R G B)
KdDiffuse color (R G B)
KsSpecular color (R G B)
KeEmissive color (R G B)
TfTransmission filter color (R G B)
dDissolve (alpha), 1 = opaque, 0 = fully transparent
TrTransparency (inverted alpha), alpha = 1 - Tr
NsSpecular exponent (shininess)
NiIndex of refraction (ior)
illumIllumination model (stored as-is)
map_KaAmbient texture → material.textures.map
map_KdDiffuse texture → material.textures.map
map_bumpBump map → material.textures.bump
bumpAlternate bump map directive → material.textures.bump