Skip to content

MaterialFacts beta ​

Interface of @v12-engine/client/common

ts
export interface MaterialFacts

A material of the file, as its maker set it: before the game's own replaces it

Members ​

alpha ​

ts
alpha: 'opaque' | 'mask' | 'blend';

Solid, cut where its alpha is under alphaCutoff, or blended with what is behind it

alphaCutoff ​

ts
alphaCutoff?: number;

The alpha value under which a mask material is cut away, 0..1

color ​

ts
color: [number, number, number, number];

Its colour, red, green, blue and alpha from 0 to 1, over its colour texture

doubleSided ​

ts
doubleSided: boolean;

Drawn from behind too

emissive ​

ts
emissive: [number, number, number];

The light it gives of itself

extensions ​

ts
extensions: string[];

The glTF extensions it is written with (KHR_materials_unlit...)

index ​

ts
index: number;

Its place among the file's materials

kind ​

ts
kind: 'pbr' | 'unlit';

Lit as metal and roughness say (PBR), or its colour alone (unlit)

metallic ​

ts
metallic: number;

How much metal it is, and how rough, from 0 to 1

name ​

ts
name: string;

As the file names it

roughness ​

ts
roughness: number;

How rough the surface is, 0 smooth to 1 rough

textures ​

ts
textures: {
        slot: 'color' | 'metal & roughness' | 'normal' | 'occlusion' | 'emissive' | string;
        texture: number;
    }[];

The textures it reads, by what for