Skip to content
On this page

Class: Material

WebSG.Material

The Material class represents a material in a scene.

Table of contents

Constructors

Accessors

Constructors

constructor

new Material(props)

Creates a new Material instance.

Parameters

NameTypeDescription
propsMaterialPropsThe properties to create the material with.

Defined in

websg.d.ts:414

Accessors

baseColorFactor

get baseColorFactor(): RGBA

Returns the base color factor of the Material object as an RGBA instance.

Returns

RGBA

Defined in

websg.d.ts:419


baseColorTexture

get baseColorTexture(): undefined | Texture

Gets the base color texture of the Material object.

Returns

undefined | Texture

Defined in

websg.d.ts:424

set baseColorTexture(texture): void

Sets the base color texture of the Material object.

Parameters

NameTypeDescription
textureundefined | TextureThe new base color texture.

Returns

void

Defined in

websg.d.ts:430


emissiveFactor

get emissiveFactor(): RGB

Returns the emissive factor of the Material object as an RGB instance.

Returns

RGB

Defined in

websg.d.ts:457


metallicFactor

get metallicFactor(): number

Gets the metallic factor of the Material object.

Returns

number

Defined in

websg.d.ts:435

set metallicFactor(value): void

Sets the metallic factor of the Material object.

Parameters

NameTypeDescription
valuenumberThe new metallic factor value.

Returns

void

Defined in

websg.d.ts:441


roughnessFactor

get roughnessFactor(): number

Gets the roughness factor of the Material object.

Returns

number

Defined in

websg.d.ts:446

set roughnessFactor(value): void

Sets the roughness factor of the Material object.

Parameters

NameTypeDescription
valuenumberThe new roughness factor value.

Returns

void

Defined in

websg.d.ts:452