@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?
optionalalphaTest?:number
alphaTexture?
optionalalphaTexture?:string
Alpha (opacity) map — linear; only the green channel is read.
aoMapIntensity?
optionalaoMapIntensity?:number
AO strength (THREE aoMapIntensity). Defaults to 1.
aoTexture?
optionalaoTexture?:string
Ambient-occlusion map — linear; sampled from the red channel (needs uv1).
bumpScale?
optionalbumpScale?:number
Bump-map strength (THREE bumpScale). Defaults to 1.
bumpTexture?
optionalbumpTexture?:string
Bump (height) map — linear; grayscale perturbs normals.
color?
optionalcolor?:number
displacementBias?
optionaldisplacementBias?:number
Displacement offset (THREE displacementBias). Defaults to 0.
displacementScale?
optionaldisplacementScale?:number
Displacement amount (THREE displacementScale). Defaults to 1.
displacementTexture?
optionaldisplacementTexture?:string
Displacement (height) map — linear; physically moves vertices (needs subdivision).
emissive?
optionalemissive?:number
Emissive color hex (default black = no emission).
emissiveIntensity?
optionalemissiveIntensity?:number
Emissive strength multiplier (THREE emissiveIntensity). Defaults to 1.
emissiveTexture?
optionalemissiveTexture?:string
Emissive map — srgb; multiplied by emissive × emissiveIntensity.
envMapIntensity?
optionalenvMapIntensity?:number
envTexture?
optionalenvTexture?:string
Environment (reflection) map — an equirectangular texture used for reflections.
flatShading?
optionalflatShading?:boolean
Faceted shading (THREE flatShading). Defaults to false.
flipY?
optionalflipY?:boolean
Flip texture V on upload (set false for KTX2/GLB bottom-origin maps).
id?
optionalid?:string
Stable UUID — written once at import, never changes across renames/moves.
lightMapIntensity?
optionallightMapIntensity?:number
Light-map strength (THREE lightMapIntensity). Defaults to 1.
lightTexture?
optionallightTexture?:string
Baked light map — srgb (needs uv1).
metalness?
optionalmetalness?:number
metalnessTexture?
optionalmetalnessTexture?:string
Metalness map — linear; sampled from the blue channel.
normalScale?
optionalnormalScale?:number
Normal-map strength (THREE normalScale, both axes). Defaults to 1.
normalTexture?
optionalnormalTexture?:string
Tangent-space normal map — linear.
opacity?
optionalopacity?:number
roughness?
optionalroughness?:number
roughnessTexture?
optionalroughnessTexture?:string
Roughness map — linear; sampled from the green channel.
side?
optionalside?:"front"|"double"|"back"
texture?
optionaltexture?:string
Base-color (albedo) map — srgb.
transparent?
optionaltransparent?:boolean
version
version:
1
vertexColors?
optionalvertexColors?:boolean
Multiply by per-vertex colors (THREE vertexColors). Defaults to false.
wireframe?
optionalwireframe?:boolean
Render edges only (THREE wireframe). Defaults to false.