Skip to content

MaterialDef beta ​

Interface of @v12-engine/client

ts
export interface MaterialDef

One of a model's materials as its look says (ModelDef.material): the material of its file, lit as materials says, with what is given here over it (docs/world/materials.md)

Members ​

alpha ​

ts
alpha?: number;

How opaque it is, 0..1: 1 as made

backFaces ​

ts
backFaces?: boolean;

Both sides of its faces drawn and lit (a leaf, a cape), or one (false): as the file says when left out

color ​

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

Its colour, 0..1 each: the diffuse colour of a standard one, the albedo of a PBR one. Its picture's is multiplied by it

emissive ​

ts
emissive?: [number, number, number];

What it shines of itself, 0..1 each, in the dark too: glows past its edges as ModelDef.glow says

emissiveTexture ​

ts
emissiveTexture?: string;

A picture of what shines, by its path in textures/

metallic ​

ts
metallic?: number;

How metal it is, 0..1, a PBR one's

normalTexture ​

ts
normalTexture?: string;

A normal map, by its path in textures/: the model's tangents, where it has them, cost WebGPU three outputs (varyingBudget)

roughness ​

ts
roughness?: number;

How rough it is, 0..1, a PBR one's

specular ​

ts
specular?: [number, number, number];

Its highlights' colour, a standard material's: black (none) as the client makes them

texture ​

ts
texture?: string;

Its picture in place of the file's, by its path in textures/ (or an address)