Creates a new WebaniMaterial instance with the provided options.
The configuration options for the material.
OptionalbaseThe image used for the base color texture (optional).
The WebGL texture for the base color (generated from baseColorImage).
The base color of the material.
The metallic property of the material, where 0 is non-metallic and 1 is metallic.
OptionalmetallicThe image used for the metallic-roughness texture (optional).
The WebGL texture for the metallic-roughness map (generated from metallicRoughnessImage).
The WebGL texture for the normal map (generated from normalMapImage).
OptionalnormalThe image used for the normal map (optional).
OptionalnormalThe scaling factor for the normal map (optional).
The opacity of the material, where 0 is fully transparent and 1 is fully opaque.
The roughness of the material, where 0 is smooth and 1 is rough.
Creates a shallow copy of the material. This includes copying texture references but not the WebGL contexts the material is bound to.
A new WebaniMaterial instance that is a shallow copy of the current material.
Binds the material to a WebGL rendering context. This method will only bind the material to a context if it hasn't been bound before.
The WebGL2 rendering context to bind the material to.
Regenerates the textures for the material based on the images provided. This will delete the existing textures and create new ones.
The WebGL2 rendering context used to regenerate the textures.
A material that defines the properties and textures used in rendering an object. This includes the color, roughness, metallic, opacity, and textures for base color, metallic-roughness, and normal maps.