API

Interface StandardMaterialProps

StandardMaterial properties — plain data.

interface StandardMaterialProps {
    alpha: number;
    alphaCutOff: number;
    ambientColor: [number, number, number];
    ambientCoordIndex: 0 | 1;
    ambientTexLevel: number;
    backFaceCulling: boolean;
    bumpLevel: number;
    diffuseColor: [number, number, number];
    diffuseCoordIndex: 0 | 1;
    diffuseTexture: Texture2D | null;
    disableLighting: boolean;
    emissiveColor: [number, number, number];
    lightmapCoordIndex: 0 | 1;
    lightmapLevel: number;
    metadata?: LiteMetadata;
    name?: string;
    opacityFromRGB: boolean;
    opacityLevel: number;
    plugins?: MaterialPlugin[];
    reflectionCoordMode: 1 | 2;
    reflectionLevel: number;
    specularColor: [number, number, number];
    specularCoordIndex: 0 | 1;
    specularPower: number;
    stencil?: StencilState;
    useLightmapAsShadowmap: boolean;
    uvOffset?: [number, number];
    uvScale: [number, number];
}

Hierarchy (View Summary)

Index
alpha: number
alphaCutOff: number

Alpha test cutoff. Fragments with alpha < alphaCutOff are discarded. Default 0 (no alpha test).

ambientColor: [number, number, number]
ambientCoordIndex: 0 | 1

Ambient texture UV channel. 0=UV1, 1=UV2. Default 0.

ambientTexLevel: number

Ambient texture intensity. Default 1.0.

backFaceCulling: boolean

Back-face culling. Default true (BJS convention). False = double-sided.

bumpLevel: number

Bump perturbation strength. Default 1.0 (maps to 1/level in BJS).

diffuseColor: [number, number, number]
diffuseCoordIndex: 0 | 1

Diffuse texture UV channel. 0=UV1, 1=UV2. Default 0.

diffuseTexture: Texture2D | null

Optional diffuse texture. Null = solid color only.

disableLighting: boolean

When true, skip all lighting and output emissive * diffuse * baseColor. Default false.

emissiveColor: [number, number, number]
lightmapCoordIndex: 0 | 1

Lightmap UV channel. 0=UV1, 1=UV2. Default 1 (BJS convention).

lightmapLevel: number

Lightmap intensity. Default 1.0.

metadata?: LiteMetadata

User metadata. glTF loads populate metadata.gltf.extras when source extras exist.

name?: string

Optional human-readable name. Populated by loaders from the source asset (e.g. the glTF material name) so callers can look a material up by name.

opacityFromRGB: boolean

When true, derive opacity from RGB luminance instead of .a channel. Default false.

opacityLevel: number

Opacity texture intensity. Default 1.0.

plugins?: MaterialPlugin[]

Optional opt-in material plugins (custom WGSL + uniforms + samplers layered on top of the built-in Standard pipeline). Attach via material.plugins = [plugin], then call enableMaterialPlugins(scene) before registerScene.

reflectionCoordMode: 1 | 2

Reflection coordinate mode. 1=spherical, 2=planar. Default 1.

reflectionLevel: number

Reflection intensity. Default 1.0.

specularColor: [number, number, number]
specularCoordIndex: 0 | 1

Specular texture UV channel. 0=UV1, 1=UV2. Default 0.

specularPower: number
stencil?: StencilState

Optional stencil-test state baked into the main-pass pipeline (mask write / discard). Default none. See StencilState.

useLightmapAsShadowmap: boolean

When true, the lightmap is a baked shadowmap that multiplies the final color (color *= lightmap * level) instead of being added. Matches BJS StandardMaterial.useLightmapAsShadowmap. Default false.

uvOffset?: [number, number]

Optional UV translation applied after scale. Missing values behave as [0, 0].

uvScale: [number, number]

UV tiling scale. Default [1, 1].