Skip to content

@modoki/engine / index / MaterialAsset

Interface: MaterialAsset ​

Material asset file format (*.mat.json) — the full MeshStandardMaterial authoring surface. All texture fields accept a guid or path. A map's colorspace is the texture's own concern (its .meta.json colorspace): color maps (base/emissive/light) are srgb, data maps (normal/rough/metal/ao/bump/ displacement/alpha) must be linear. Note the THREE convention — a roughnessTexture is sampled from the green channel, metalnessTexture from blue — so a packed metallic-roughness map can be referenced by both fields. When a data map is present its scalar factor multiplies the map, so set metalness/roughness to 1 to let the map drive the value (a 0 metalness factor zeroes the map). aoTexture/lightTexture need a 2nd UV set (uv1) on the geometry — without one THREE samples them from the base uv.

Traits ​

alphaTest? ​

optional alphaTest?: number


alphaTexture? ​

optional alphaTexture?: string

Alpha (opacity) map — linear; only the green channel is read.


aoMapIntensity? ​

optional aoMapIntensity?: number

AO strength (THREE aoMapIntensity). Defaults to 1.


aoTexture? ​

optional aoTexture?: string

Ambient-occlusion map — linear; sampled from the red channel (needs uv1).


bumpScale? ​

optional bumpScale?: number

Bump-map strength (THREE bumpScale). Defaults to 1.


bumpTexture? ​

optional bumpTexture?: string

Bump (height) map — linear; grayscale perturbs normals.


color? ​

optional color?: number


displacementBias? ​

optional displacementBias?: number

Displacement offset (THREE displacementBias). Defaults to 0.


displacementScale? ​

optional displacementScale?: number

Displacement amount (THREE displacementScale). Defaults to 1.


displacementTexture? ​

optional displacementTexture?: string

Displacement (height) map — linear; physically moves vertices (needs subdivision).


emissive? ​

optional emissive?: number

Emissive color hex (default black = no emission).


emissiveIntensity? ​

optional emissiveIntensity?: number

Emissive strength multiplier (THREE emissiveIntensity). Defaults to 1.


emissiveTexture? ​

optional emissiveTexture?: string

Emissive map — srgb; multiplied by emissive × emissiveIntensity.


envMapIntensity? ​

optional envMapIntensity?: number


envTexture? ​

optional envTexture?: string

Environment (reflection) map — an equirectangular texture used for reflections.


flatShading? ​

optional flatShading?: boolean

Faceted shading (THREE flatShading). Defaults to false.


flipY? ​

optional flipY?: boolean

Flip texture V on upload (set false for KTX2/GLB bottom-origin maps).


id? ​

optional id?: string

Stable UUID — written once at import, never changes across renames/moves.


lightMapIntensity? ​

optional lightMapIntensity?: number

Light-map strength (THREE lightMapIntensity). Defaults to 1.


lightTexture? ​

optional lightTexture?: string

Baked light map — srgb (needs uv1).


metalness? ​

optional metalness?: number


metalnessTexture? ​

optional metalnessTexture?: string

Metalness map — linear; sampled from the blue channel.


normalScale? ​

optional normalScale?: number

Normal-map strength (THREE normalScale, both axes). Defaults to 1.


normalTexture? ​

optional normalTexture?: string

Tangent-space normal map — linear.


opacity? ​

optional opacity?: number


roughness? ​

optional roughness?: number


roughnessTexture? ​

optional roughnessTexture?: string

Roughness map — linear; sampled from the green channel.


side? ​

optional side?: "front" | "double" | "back"


texture? ​

optional texture?: string

Base-color (albedo) map — srgb.


transparent? ​

optional transparent?: boolean


version ​

version: 1


vertexColors? ​

optional vertexColors?: boolean

Multiply by per-vertex colors (THREE vertexColors). Defaults to false.


wireframe? ​

optional wireframe?: boolean

Render edges only (THREE wireframe). Defaults to false.

Built with Modoki.