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
Name | Type | Description |
---|---|---|
props | MaterialProps | The properties to create the material with. |
Defined in
Accessors
baseColorFactor
• get
baseColorFactor(): RGBA
Returns the base color factor of the Material object as an RGBA instance.
Returns
Defined in
baseColorTexture
• get
baseColorTexture(): undefined
| Texture
Gets the base color texture of the Material object.
Returns
undefined
| Texture
Defined in
• set
baseColorTexture(texture
): void
Sets the base color texture of the Material object.
Parameters
Name | Type | Description |
---|---|---|
texture | undefined | Texture | The new base color texture. |
Returns
void
Defined in
emissiveFactor
• get
emissiveFactor(): RGB
Returns the emissive factor of the Material object as an RGB instance.
Returns
Defined in
metallicFactor
• get
metallicFactor(): number
Gets the metallic factor of the Material object.
Returns
number
Defined in
• set
metallicFactor(value
): void
Sets the metallic factor of the Material object.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new metallic factor value. |
Returns
void
Defined in
roughnessFactor
• get
roughnessFactor(): number
Gets the roughness factor of the Material object.
Returns
number
Defined in
• set
roughnessFactor(value
): void
Sets the roughness factor of the Material object.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new roughness factor value. |
Returns
void