Material
The Material class defines how a 3D surface is rendered, extending the Item base class. It provides options for culling, shading workflows, texture wrapping and filtering, anisotropy, normal mapping, and blending. Materials are applied to objects in a scene to control their appearance, from solid opaque surfaces to transparent or stylized effects.
Inherits from
Usage
To use this class, add the following require at the top of your script:
Reference
create
Create a new material instance.
This function initializes a new Material object with specified attributes. The attributes can include colors, textures, shader links, floats, enums, and other material properties. All attributes are optional and override engine defaults.
Parameters
selfattributes(table): Optional table of material attributes to override defaults.
Example
local customMaterial = Material:create({
DiffuseColor = { r=200, g=100, b=50, a=255 },
RoughnessIntensity = 0.8,
MaterialType = Material.MaterialType.Toon
})
Properties
You can access these properties directly on the object or through :get("propertyName") or :set("propertyName", value) methods.
| Property | Type | Default | Description |
|---|---|---|---|
| materialType | Enum | Physical | Options: Physical, Shader, Point, Basic, Normal, Toon, Matcap, Lambert, Phong |
| vertexColors | Boolean | false | |
| alphaTest | Float | 0 | |
| transparent | Boolean | false | |
| mode | Enum | Normal | Options: None, Normal, Additive, Subtractive, Multiply, Custom |
| active | Boolean | true | |
| mode | Enum | Back | Options: Front, Back, Off |
getWorkflow
Retrieves the workflow value for the material.
Returns
string: current workflow value of the material. Expected to be a value from Material.Workflow.
setWorkflow
Sets the workflow for the material.
Parameters
workflow(string): The desired workflow value. Expected to be a value from Material.Workflow.
getAttenuationColor
Retrieves the attenuation color for the material.
Returns
Color: table representing the RGB color values, or any suitable color representation of the attenuation color.
setAttenuationColor
Sets the attenuation color for the material.
Parameters
color(Color): A table representing the RGB color values, or any suitable color representation.
getAttenuationDistance
Retrieves the attenuation distance for the material.
Returns
number: number representing the attenuation distance.
setAttenuationDistance
Sets the attenuation distance for the material.
Parameters
distance(number): A number representing the attenuation distance.
getDiffuseColor
Retrieves the diffuse color for the material.
Returns
Color: diffuse color
setDiffuseColor
Sets the diffuse color for the material.
Parameters
color(Color): The diffuse color to set
getAlbedoMap
Get the albedo texture or video or nil if none is linked
Returns
Texture: Video or nil
setAlbedoMap
Set the albedo texture or video
Parameters
linkItem(texture): or video to use
getAlbedoWrapS
Gets the wrap mode along the s-axis (usually horizontal) for the albedo map.
Returns
WrapMode
setAlbedoWrapS
Sets the wrap mode along the s-axis (usually horizontal) for the albedo map.
Parameters
mode
getAlbedoWrapT
Sets the wrap mode along the t-axis (usually vertical) for the albedo map.
Returns
WrapMode
setAlbedoWrapT
Sets the wrap mode along the t-axis (usually vertical) for the albedo map.
Parameters
mode
getAlbedoMagFilter
Gets the magnification filter for the albedo map.
Returns
MagFilter: magnification filter.
setAlbedoMagFilter
Sets the magnification filter for the albedo map.
Parameters
filter(MagFilter): The magnification filter.
getAlbedoMinFilter
Gets the minification filter for the albedo map.
Returns
MinFilter: minification filter..
setAlbedoMinFilter
Sets the minification filter for the albedo map.
Parameters
filter(MinFilter): The minification filter..
getAlbedoAnisotropy
Gets the anisotropy level for the albedo map.
Returns
Anisotropy: anisotropy level..
setAlbedoAnisotropy
Sets the anisotropy level for the albedo map.
Parameters
anisotropy
getAlphaTest
Get the alpha test value of the material.
Returns
number: alpha test value.
setAlphaTest
Set the alpha test value of the material.
Parameters
amount(number): The alpha test value.
getTransparent
Check if the material is transparent.
Returns
boolean: if transparent, false otherwise.
setTransparent
Set the transparency of the material.
Parameters
enabled(boolean): True if transparent, false otherwise.
getOpacity
Get the opacity of the material.
Returns
number: opacity value.
setOpacity
Set the opacity of the material.
Parameters
amount(number): The opacity value.
getAlphaMap
Get the alpha map of the material.
Returns
Texture: alpha map texture.
setAlphaMap
Set the alpha map of the material.
Parameters
texture(Texture): The alpha map texture.
getAlphaWrapS
Get the alpha wrap S mode of the material.
Returns
WrapMode: wrap mode.
setAlphaWrapS
Set the alpha wrap S mode of the material.
Parameters
mode(WrapMode): The wrap mode.
getAlphaWrapT
Get the alpha wrap T mode of the material.
Returns
WrapMode: wrap mode.
setAlphaWrapT
Set the alpha wrap T mode of the material.
Parameters
mode(WrapMode): The wrap mode.
getAlphaMagFilter
Get the alpha magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setAlphaMagFilter
Set the alpha magnification filter of the material.
Parameters
filter(MagFilter): The magnification filter mode.
getAlphaMinFilter
Get the alpha minification filter of the material.
Returns
MinFilter: minification filter mode.
setAlphaMinFilter
Set the alpha minification filter of the material.
Parameters
filter(MinFilter): The minification filter mode.
getAlphaAnisotropy
Get the alpha anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setAlphaAnisotropy
Set the alpha anisotropy mode of the material.
Parameters
anisotropy
getEmissiveColor
Get the emissive color of the material.
Returns
Color: emissive color.
setEmissiveColor
Set the emissive color of the material.
Parameters
color(Color): The emissive color. Default is black.
getEmissiveMap
Get the emissive texture or nil if none is linked.
Returns
Texture: texture or nil.
setEmissiveMap
Set the emissive texture.
Parameters
texture(Texture): Texture to use or nil.
getEmissiveWrapS
Get the emissive wrap S mode of the material.
Returns
WrapMode: wrap mode.
setEmissiveWrapS
Set the emissive wrap S mode of the material.
Parameters
mode
getEmissiveWrapT
Get the emissive wrap T mode of the material.
Returns
WrapMode: wrap mode.
setEmissiveWrapT
Set the emissive wrap T mode of the material.
Parameters
mode
getEmissiveMagFilter
Get the emissive magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setEmissiveMagFilter
Set the emissive magnification filter of the material.
Parameters
filter
getEmissiveMinFilter
Get the emissive minification filter of the material.
Returns
MinFilter: minification filter mode.
setEmissiveMinFilter
Set the emissive minification filter of the material.
Parameters
filter
getEmissiveAnisotropy
Get the emissive anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setEmissiveAnisotropy
Set the emissive anisotropy mode of the material.
Parameters
anisotropy
getSheenAmount
Get the sheen amount of the material.
Returns
number: sheen value.
setSheenAmount
Set the sheen amount of the material.
Parameters
amount(number): The sheen value.
getSheenRoughness
Get the sheen roughness value of the material.
Returns
number: sheen roughness value.
setSheenRoughness
Set the sheen roughness value of the material.
Parameters
amount(number): The sheen roughness value.
getSheenRoughnessMap
Get the sheen roughness map of the material.
Returns
Texture: sheen roughness texture.
setSheenRoughnessMap
Set the sheen roughness map of the material.
Parameters
texture(Texture): Texture to use or nil.
getSheenRoughnessWrapS
Get the sheen roughness wrap S mode of the material.
Returns
WrapMode: wrap mode.
setSheenRoughnessWrapS
Set the sheen roughness wrap S mode of the material.
Parameters
mode
getSheenRoughnessWrapT
Get the sheen roughness wrap T mode of the material.
Returns
WrapMode: wrap mode.
setSheenRoughnessWrapT
Set the sheen roughness wrap T mode of the material.
Parameters
mode
getSheenRoughnessMagFilter
Get the sheen roughness magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setSheenRoughnessMagFilter
Set the sheen roughness magnification filter of the material.
Parameters
filter
getSheenRoughnessMinFilter
Get the sheen roughness minification filter of the material.
Returns
MinFilter: minification filter mode.
setSheenRoughnessMinFilter
Set the sheen roughness minification filter of the material.
Parameters
filter
getSheenRoughnessAnisotropy
Get the sheen roughness anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setSheenRoughnessAnisotropy
Set the sheen roughness anisotropy mode of the material.
Parameters
anisotropy
getSheenColor
Get the sheen color of the material.
Returns
Color: sheen color.
setSheenColor
Set the sheen color of the material.
Parameters
color(Color): The sheen color.
getSheenColorMap
Get the sheen color map of the material.
Returns
Texture: sheen color texture.
setSheenColorMap
Set the sheen color map of the material.
Parameters
texture(Texture): Texture to use or nil.
getSheenColorWrapS
Get the sheen color wrap S mode of the material.
Returns
WrapMode: wrap mode.
setSheenColorWrapS
Set the sheen color wrap S mode of the material.
Parameters
mode
getSheenColorWrapT
Get the sheen color wrap T mode of the material.
Returns
WrapMode: wrap mode.
setSheenColorWrapT
Set the sheen color wrap T mode of the material.
Parameters
mode
getSheenColorMagFilter
Get the sheen color magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setSheenColorMagFilter
Set the sheen color magnification filter of the material.
Parameters
filter
getSheenColorMinFilter
Get the sheen color minification filter of the material.
Returns
MinFilter: minification filter mode.
setSheenColorMinFilter
Set the sheen color minification filter of the material.
Parameters
filter
getSheenColorAnisotropy
Get the sheen color anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setSheenColorAnisotropy
Set the sheen color anisotropy mode of the material.
Parameters
anisotropy
getNormalMap
Get the normal map texture of the material.
Returns
Texture: normal map texture.
setNormalMap
Set the normal map texture of the material.
Parameters
texture(Texture): The texture to use or nil.
getNormalScale
Get the normal scale value of the material.
Returns
number: normal scale value.
setNormalScale
Set the normal scale value of the material.
Parameters
scale(number): The normal scale value.
getNormalType
Get the normal type of the material.
Returns
NormalType: normal type.
setNormalType
Set the normal type of the material.
Parameters
type(NormalType): The normal type.
getNormalWrapS
Get the normal wrap S mode of the material.
Returns
WrapMode: wrap mode.
setNormalWrapS
Set the normal wrap S mode of the material.
Parameters
mode
getNormalWrapT
Get the normal wrap T mode of the material.
Returns
WrapMode: wrap mode.
setNormalWrapT
Set the normal wrap T mode of the material.
Parameters
mode
getNormalMagFilter
Get the normal magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setNormalMagFilter
Set the normal magnification filter of the material.
Parameters
filter
getNormalMinFilter
Get the normal minification filter of the material.
Returns
MinFilter: minification filter mode.
setNormalMinFilter
Set the normal minification filter of the material.
Parameters
filter
getNormalAnisotropy
Get the normal anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setNormalAnisotropy
Set the normal anisotropy mode of the material.
Parameters
anisotropy
getRoughnessIntensity
Get the roughness intensity value of the material.
Returns
number: roughness intensity value.
setRoughnessIntensity
Set the roughness intensity value of the material.
Parameters
amount(number): The roughness intensity value.
getRoughnessMap
Get the roughness map texture of the material.
Returns
Texture: roughness map texture.
setRoughnessMap
Set the roughness map texture of the material.
Parameters
texture(Texture): The texture to use or nil.
getRoughnessWrapS
Get the roughness wrap S mode of the material.
Returns
WrapMode: wrap mode.
setRoughnessWrapS
Set the roughness wrap S mode of the material.
Parameters
mode
getRoughnessWrapT
Get the roughness wrap T mode of the material.
Returns
WrapMode: wrap mode.
setRoughnessWrapT
Set the roughness wrap T mode of the material.
Parameters
mode
getRoughnessMagFilter
Get the roughness magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setRoughnessMagFilter
Set the roughness magnification filter of the material.
Parameters
filter
getRoughnessMinFilter
Get the roughness minification filter of the material.
Returns
MinFilter: minification filter mode.
setRoughnessMinFilter
Set the roughness minification filter of the material.
Parameters
filter
getRoughnessAnisotropy
Get the roughness anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setRoughnessAnisotropy
Set the roughness anisotropy mode of the material.
Parameters
anisotropy
getMetalnessIntensity
Get the metalness intensity value of the material.
Returns
number: metalness intensity value.
setMetalnessIntensity
Set the metalness intensity value of the material.
Parameters
amount(number): The metalness intensity value.
getMetalnessMap
Get the metalness map texture of the material.
Returns
Texture: metalness map texture.
setMetalnessMap
Set the metalness map texture of the material.
Parameters
texture(Texture): The texture to use or nil.
getMetalnessWrapS
Get the metalness wrap S mode of the material.
Returns
WrapMode: wrap mode.
setMetalnessWrapS
Set the metalness wrap S mode of the material.
Parameters
mode
getMetalnessWrapT
Get the metalness wrap T mode of the material.
Returns
WrapMode: wrap mode.
setMetalnessWrapT
Set the metalness wrap T mode of the material.
Parameters
mode
getMetalnessMagFilter
Get the metalness magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setMetalnessMagFilter
Set the metalness magnification filter of the material.
Parameters
filter
getMetalnessMinFilter
Get the metalness minification filter of the material.
Returns
MinFilter: minification filter mode.
setMetalnessMinFilter
Set the metalness minification filter of the material.
Parameters
filter
getMetalnessAnisotropy
Get the metalness anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setMetalnessAnisotropy
Set the metalness anisotropy mode of the material.
Parameters
anisotropy
getSpecularIntensity
Get the specular intensity value of the material.
Returns
number: specular intensity value.
setSpecularIntensity
Set the specular intensity value of the material.
Parameters
amount(number): The specular intensity value.
getSpecularIntensityMap
Get the specular intensity map texture of the material.
Returns
Texture: specular intensity map texture.
setSpecularIntensityMap
Set the specular intensity map texture of the material.
Parameters
texture(Texture): The texture to use or nil.
getSpecularIntensityWrapS
Get the specular intensity wrap S mode of the material.
Returns
WrapMode: wrap mode.
setSpecularIntensityWrapS
Set the specular intensity wrap S mode of the material.
Parameters
mode
getSpecularIntensityWrapT
Get the specular intensity wrap T mode of the material.
Returns
WrapMode: wrap mode.
setSpecularIntensityWrapT
Set the specular intensity wrap T mode of the material.
Parameters
mode
getSpecularIntensityMagFilter
Get the specular intensity magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setSpecularIntensityMagFilter
Set the specular intensity magnification filter of the material.
Parameters
filter
getSpecularIntensityMinFilter
Get the specular intensity minification filter of the material.
Returns
MinFilter: minification filter mode.
setSpecularIntensityMinFilter
Set the specular intensity minification filter of the material.
Parameters
filter
getSpecularIntensityAnisotropy
Get the specular intensity anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setSpecularIntensityAnisotropy
Set the specular intensity anisotropy mode of the material.
Parameters
anisotropy
getSpecularColor
Get the specular color of the material.
Returns
string: specular color value.
setSpecularColor
Set the specular color of the material.
Parameters
color(string): The specular color value.
getSpecularColorMap
Get the specular color map texture of the material.
Returns
Texture: specular color map texture.
setSpecularColorMap
Set the specular color map texture of the material.
Parameters
texture(Texture): The texture to use or nil.
getSpecularColorWrapS
Get the specular color wrap S mode of the material.
Returns
WrapMode: wrap mode.
setSpecularColorWrapS
Set the specular color wrap S mode of the material.
Parameters
mode
getSpecularColorWrapT
Get the specular color wrap T mode of the material.
Returns
WrapMode: wrap mode.
setSpecularColorWrapT
Set the specular color wrap T mode of the material.
Parameters
mode
getSpecularColorMagFilter
Get the specular color magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setSpecularColorMagFilter
Set the specular color magnification filter of the material.
Parameters
filter
getSpecularColorMinFilter
Get the specular color minification filter of the material.
Returns
MinFilter: minification filter mode.
setSpecularColorMinFilter
Set the specular color minification filter of the material.
Parameters
filter
getSpecularColorAnisotropy
Get the specular color anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setSpecularColorAnisotropy
Set the specular color anisotropy mode of the material.
Parameters
anisotropy
getAmbientOcclusionMap
Get the ambient occlusion map texture of the material.
Returns
Texture: ambient occlusion map texture.
setAmbientOcclusionMap
Set the ambient occlusion map texture of the material.
Parameters
texture(Texture): The texture to use or nil.
getAmbientOcclusionIntensity
Get the ambient occlusion intensity of the material.
Returns
string: ambient occlusion intensity value.
setAmbientOcclusionIntensity
Set the ambient occlusion intensity of the material.
Parameters
amount(string): The ambient occlusion intensity value.
getAmbientOcclusionWrapS
Get the ambient occlusion wrap S mode of the material.
Returns
WrapMode: wrap mode.
setAmbientOcclusionWrapS
Set the ambient occlusion wrap S mode of the material.
Parameters
mode
getAmbientOcclusionWrapT
Get the ambient occlusion wrap T mode of the material.
Returns
WrapMode: wrap mode.
setAmbientOcclusionWrapT
Set the ambient occlusion wrap T mode of the material.
Parameters
mode
getAmbientOcclusionMagFilter
Get the ambient occlusion magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setAmbientOcclusionMagFilter
Set the ambient occlusion magnification filter of the material.
Parameters
filter
getAmbientOcclusionMinFilter
Get the ambient occlusion minification filter of the material.
Returns
MinFilter: minification filter mode.
setAmbientOcclusionMinFilter
Set the ambient occlusion minification filter of the material.
Parameters
filter
getAmbientOcclusionAnisotropy
Get the ambient occlusion anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setAmbientOcclusionAnisotropy
Set the ambient occlusion anisotropy mode of the material.
Parameters
anisotropy
getClearcoatLevel
Get the clearcoat level of the material.
Returns
string: clearcoat level value.
setClearcoatLevel
Set the clearcoat level of the material.
Parameters
amount(string): The clearcoat level value.
getClearcoatMap
Get the clearcoat map texture of the material.
Returns
Texture: clearcoat map texture.
setClearcoatMap
Set the clearcoat map texture of the material.
Parameters
texture(Texture): The texture to use or nil.
getClearcoatWrapS
Get the clearcoat wrap S mode of the material.
Returns
WrapMode: wrap mode.
setClearcoatWrapS
Set the clearcoat wrap S mode of the material.
Parameters
mode
getClearcoatWrapT
Get the clearcoat wrap T mode of the material.
Returns
WrapMode: wrap mode.
setClearcoatWrapT
Set the clearcoat wrap T mode of the material.
Parameters
mode
getClearcoatMagFilter
Get the clearcoat magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setClearcoatMagFilter
Set the clearcoat magnification filter of the material.
Parameters
filter
getClearcoatMinFilter
Get the clearcoat minification filter of the material.
Returns
MinFilter: minification filter mode.
setClearcoatMinFilter
Set the clearcoat minification filter of the material.
Parameters
filter
getClearcoatAnisotropy
Get the clearcoat anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setClearcoatAnisotropy
Set the clearcoat anisotropy mode of the material.
Parameters
anisotropy
getClearcoatNormalMap
Get the clearcoat normal map texture of the material.
Returns
Texture: clearcoat normal map texture.
setClearcoatNormalMap
Set the clearcoat normal map texture of the material.
Parameters
texture(Texture): The texture to use or nil.
getClearcoatNormalScale
Get the clearcoat normal scale of the material.
Returns
number: clearcoat normal scale value.
setClearcoatNormalScale
Set the clearcoat normal scale of the material.
Parameters
scale(number): The clearcoat normal scale value.
getClearcoatNormalWrapS
Get the clearcoat normal wrap S mode of the material.
Returns
WrapMode: wrap mode.
setClearcoatNormalWrapS
Set the clearcoat normal wrap S mode of the material.
Parameters
mode
getClearcoatNormalWrapT
Get the clearcoat normal wrap T mode of the material.
Returns
WrapMode: wrap mode.
setClearcoatNormalWrapT
Set the clearcoat normal wrap T mode of the material.
Parameters
mode
getClearcoatNormalMagFilter
Get the clearcoat normal magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setClearcoatNormalMagFilter
Set the clearcoat normal magnification filter of the material.
Parameters
filter
getClearcoatNormalMinFilter
Get the clearcoat normal minification filter of the material.
Returns
MinFilter: minification filter mode.
setClearcoatNormalMinFilter
Set the clearcoat normal minification filter of the material.
Parameters
filter
getClearcoatNormalAnisotropy
Get the clearcoat normal anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setClearcoatNormalAnisotropy
Set the clearcoat normal anisotropy mode of the material.
Parameters
anisotropy
getClearcoatRoughnessMap
Get the clearcoat roughness map texture of the material.
Returns
Texture: clearcoat roughness map texture.
setClearcoatRoughnessMap
Set the clearcoat roughness map texture of the material.
Parameters
texture(Texture): The texture to use or nil.
getClearcoatRoughnessIntensity
Get the clearcoat roughness intensity of the material.
Returns
number: clearcoat roughness intensity value.
setClearcoatRoughnessIntensity
Set the clearcoat roughness intensity of the material.
Parameters
amount(number): The clearcoat roughness intensity value.
getClearcoatRoughnessWrapS
Get the clearcoat roughness wrap S mode of the material.
Returns
WrapMode: wrap mode.
setClearcoatRoughnessWrapS
Set the clearcoat roughness wrap S mode of the material.
Parameters
mode
getClearcoatRoughnessWrapT
Get the clearcoat roughness wrap T mode of the material.
Returns
WrapMode: wrap mode.
setClearcoatRoughnessWrapT
Set the clearcoat roughness wrap T mode of the material.
Parameters
mode
getClearcoatRoughnessMagFilter
Get the clearcoat roughness magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setClearcoatRoughnessMagFilter
Set the clearcoat roughness magnification filter of the material.
Parameters
filter
getClearcoatRoughnessMinFilter
Get the clearcoat roughness minification filter of the material.
Returns
MinFilter: minification filter mode.
setClearcoatRoughnessMinFilter
Set the clearcoat roughness minification filter of the material.
Parameters
filter
getClearcoatRoughnessAnisotropy
Get the clearcoat roughness anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setClearcoatRoughnessAnisotropy
Set the clearcoat roughness anisotropy mode of the material.
Parameters
anisotropy
getReflectivity
Get the reflectivity of the material.
Returns
number: reflectivity value.
setReflectivity
Set the reflectivity of the material.
Parameters
value(number): The reflectivity value.
getIndexOfRefraction
Get the index of refraction of the material.
Returns
number: index of refraction value.
setIndexOfRefraction
Set the index of refraction of the material.
Parameters
value(number): The index of refraction value.
getEnvironmentMap
Get the environment map texture of the material.
Returns
Texture: environment map texture.
setEnvironmentMap
Set the environment map texture of the material.
Parameters
texture(Texture): The texture to use or nil.
getEnvironmentIntensity
Get the environment intensity of the material.
Returns
number: environment intensity value.
setEnvironmentIntensity
Set the environment intensity of the material.
Parameters
amount(number): The environment intensity value.
getThickness
Get the thickness value of the material.
Returns
number: thickness value.
setThickness
Set the thickness value of the material.
Parameters
amount(number): The thickness value.
getThicknessMap
Get the thickness map texture of the material.
Returns
string: thickness map texture.
setThicknessMap
Set the thickness map texture of the material.
Parameters
texture(string): The texture to use as the thickness map.
getThicknessWrapS
Get the wrap mode for the S axis of the thickness texture.
Returns
string: wrap mode for the S axis.
setThicknessWrapS
Set the wrap mode for the S axis of the thickness texture.
Parameters
mode(string): The wrap mode for the S axis.
getThicknessWrapT
Get the wrap mode for the T axis of the thickness texture.
Returns
string: wrap mode for the T axis.
setThicknessWrapT
Set the wrap mode for the T axis of the thickness texture.
Parameters
mode(string): The wrap mode for the T axis.
getThicknessMagFilter
Get the magnification filter for the thickness texture.
Returns
string: magnification filter.
setThicknessMagFilter
Set the magnification filter for the thickness texture.
Parameters
filter(string): The magnification filter.
getThicknessMinFilter
Get the minification filter for the thickness texture.
Returns
string: minification filter.
setThicknessMinFilter
Set the minification filter for the thickness texture.
Parameters
filter(string): The minification filter.
getThicknessAnisotropy
Get the anisotropy level for the thickness texture.
Returns
string: anisotropy level.
setThicknessAnisotropy
Set the anisotropy level for the thickness texture.
Parameters
anisotropy
getDisplacementMap
Get the displacement map texture of the material.
Returns
string: displacement map texture.
setDisplacementMap
Set the displacement map texture of the material.
Parameters
texture(string): The texture to use as the displacement map.
getDisplacementScale
Get the displacement scale of the material.
Returns
number: displacement scale.
setDisplacementScale
Set the displacement scale of the material.
Parameters
amount(number): The displacement scale value.
getDisplacementBias
Get the displacement bias of the material.
Returns
number: displacement bias.
setDisplacementBias
Set the displacement bias of the material.
Parameters
amount(number): The displacement bias value.
getDisplacementWrapS
Get the wrap mode for the S axis of the displacement texture.
Returns
string: wrap mode for the S axis.
setDisplacementWrapS
Set the wrap mode for the S axis of the displacement texture.
Parameters
mode(string): The wrap mode for the S axis.
getDisplacementWrapT
Get the wrap mode for the T axis of the displacement texture.
Returns
string: wrap mode for the T axis.
setDisplacementWrapT
Set the wrap mode for the T axis of the displacement texture.
Parameters
mode(string): The wrap mode for the T axis.
getDisplacementMagFilter
Get the magnification filter for the displacement texture.
Returns
string: magnification filter.
setDisplacementMagFilter
Set the magnification filter for the displacement texture.
Parameters
filter(string): The magnification filter.
getDisplacementMinFilter
Get the minification filter for the displacement texture.
Returns
string: minification filter.
setDisplacementMinFilter
Set the minification filter for the displacement texture.
Parameters
filter(string): The minification filter.
getDisplacementAnisotropy
Get the anisotropy level for the displacement texture.
Returns
string: anisotropy level.
setDisplacementAnisotropy
Set the anisotropy level for the displacement texture.
Parameters
anisotropy
getTransmissionMap
Get the transmission map texture of the material.
Returns
string: transmission map texture.
setTransmissionMap
Set the transmission map texture of the material.
Parameters
texture(string): The texture to use as the transmission map.
getTransmission
Get the transmission value of the material.
Returns
number: transmission value.
setTransmission
Set the transmission value of the material.
Parameters
amount(number): The transmission value to set.
getTransmissionWrapS
Get the wrap mode for the S axis of the transmission texture.
Returns
string: wrap mode for the S axis.
setTransmissionWrapS
Set the wrap mode for the S axis of the transmission texture.
Parameters
mode(string): The wrap mode for the S axis.
getTransmissionWrapT
Get the wrap mode for the T axis of the transmission texture.
Returns
string: wrap mode for the T axis.
setTransmissionWrapT
Set the wrap mode for the T axis of the transmission texture.
Parameters
mode(string): The wrap mode for the T axis.
getTransmissionMagFilter
Get the magnification filter for the transmission texture.
Returns
string: magnification filter.
setTransmissionMagFilter
Set the magnification filter for the transmission texture.
Parameters
filter(string): The magnification filter.
getTransmissionMinFilter
Get the minification filter for the transmission texture.
Returns
string: minification filter.
setTransmissionMinFilter
Set the minification filter for the transmission texture.
Parameters
filter(string): The minification filter.
getTransmissionAnisotropy
Get the anisotropy level for the transmission texture.
Returns
string: anisotropy level.
setTransmissionAnisotropy
Set the anisotropy level for the transmission texture.
Parameters
anisotropy
getBlending
Get the blending status of the material.
Returns
boolean: if blending is enabled, false otherwise.
setBlending
Enable or disable blending for the material.
Parameters
enabled(boolean): True to enable blending, false to disable.
getBlendSource
Get the source factor for the blending equation.
Returns
BlendSource: source factor for the blending equation.
setBlendSource
Set the source factor for the blending equation.
Parameters
value(BlendSource): The source factor for the blending equation.
getBlendDest
Get the destination factor for the blending equation.
Returns
BlendDest: destination factor for the blending equation.
setBlendDest
Set the destination factor for the blending equation.
Parameters
value(BlendDest): The destination factor for the blending equation.
getBlendEquation
Get the equation to use for blending.
Returns
string: equation used for blending.
setBlendEquation
Set the equation to use for blending.
Parameters
value(string): The equation to use for blending.
getDepthTest
Get the depth test status for the material.
Returns
boolean: if depth testing is enabled, false otherwise.
setDepthTest
Enable or disable depth testing for the material.
Parameters
enabled(boolean): True to enable depth testing, false to disable.
getDepthMode
Get the depth mode for the material.
Returns
string: current depth mode of the material.
setDepthMode
Set the depth mode for the material.
Parameters
mode(string): The desired depth mode for the material.
getCulling
Get the culling mode for the material.
Returns
string: current culling mode of the material.
setCulling
Set the culling mode for the material.
Parameters
mode(string): The desired culling mode for the material.
getPoints
Check if the material is set to render as points.
Returns
boolean: if the material renders as points, false otherwise.
setPoints
Enable or disable rendering the material as points.
Parameters
enabled(boolean): True to render as points, false otherwise.
getPointSize
Get the point size for the material when rendering as points.
Returns
number: point size used when rendering as points.
setPointSize
Set the point size for the material when rendering as points.
Parameters
size(number): The desired point size.
getPointSizeAttenuation
Check if point size attenuation is enabled for the material.
Returns
boolean: if point size attenuation is enabled, false otherwise.
setPointSizeAttenuation
Enable or disable point size attenuation for the material.
Parameters
enabled(boolean): True to enable point size attenuation, false to disable.
getVertexColors
Check if point vertex colors are enabled for the material.
Returns
boolean: if vertex colors are enabled, false otherwise.
setVertexColors
Enable or disable vertex colors for the material.
Parameters
enabled(boolean): True to enable vertex colors, false to disable.
getFlatShading
Check if flat shading is enabled for the material.
Returns
boolean: if flat shading is enabled, false otherwise.
setFlatShading
Enable or disable flat shading for the material.
Parameters
enabled(boolean): True to enable flat shading, false to disable.
getWireframe
Check if wireframe is enabled for the material.
Returns
boolean: if wireframe is enabled, false otherwise.
setWireframe
Enable or disable wireframe for the material.
Parameters
enabled(boolean): True to enable wireframe, false to disable.
getGradientMap
Get the gradient map of the material.
Returns
Texture: gradient map texture.
setGradientMap
Set the gradient map of the material.
Parameters
texture(Texture): The gradient map texture.
getGradientWrapS
Get the gradient wrap S mode of the material.
Returns
WrapMode: wrap mode.
setGradientWrapS
Set the gradient wrap S mode of the material.
Parameters
mode
getGradientWrapT
Get the gradient wrap T mode of the material.
Returns
WrapMode: wrap mode.
setGradientWrapT
Set the gradient wrap T mode of the material.
Parameters
mode
getGradientMagFilter
Get the gradient magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setGradientMagFilter
Set the gradient magnification filter of the material.
Parameters
filter
getGradientMinFilter
Get the gradient minification filter of the material.
Returns
MinFilter: minification filter mode.
setGradientMinFilter
Set the gradient minification filter of the material.
Parameters
filter
getGradientAnisotropy
Get the gradient anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setGradientAnisotropy
Set the gradient anisotropy mode of the material.
Parameters
anisotropy
getMatcapMap
Get the matcap map of the material.
Returns
Texture: matcap map texture.
setMatcapMap
Set the matcap map of the material.
Parameters
texture(Texture): The matcap map texture.
getMatcapWrapS
Get the matcap wrap S mode of the material.
Returns
WrapMode: wrap mode.
setMatcapWrapS
Set the matcap wrap S mode of the material.
Parameters
mode
getMatcapWrapT
Get the matcap wrap T mode of the material.
Returns
WrapMode: wrap mode.
setMatcapWrapT
Set the matcap wrap T mode of the material.
Parameters
mode
getMatcapMagFilter
Get the matcap magnification filter of the material.
Returns
MagFilter: magnification filter mode.
setMatcapMagFilter
Set the matcap magnification filter of the material.
Parameters
filter
getMatcapMinFilter
Get the matcap minification filter of the material.
Returns
MinFilter: minification filter mode.
setMatcapMinFilter
Set the matcap minification filter of the material.
Parameters
filter
getMatcapAnisotropy
Get the matcap anisotropy mode of the material.
Returns
Anisotropy: anisotropy mode.
setMatcapAnisotropy
Set the matcap anisotropy mode of the material.
Parameters
anisotropy
getShininess
Get the shininess of a phong material.
Returns
number: shininess of the material.
setShininess
Set the shininess of a phong material.
Parameters
shininess(number): The desired shininess.
setUniform
Set a uniform to a value. value has to be of type number, Vector2/3/4, Quaternion, Color or Matrix with 3x3 or 4x4 values
Parameters
name(string): name of the uniformvalue(any): value of the uniform
Enum: MaterialType
Material type enumeration Enumeration of available material types
| Field Name | Description |
|---|---|
| Physical | string: Physically-Based Rendering material |
| Shader | string: Custom GLSL shader material |
| Point | string: Point/particle rendering material |
| Basic | string: Unlit material with basic properties |
| Normal | string: Normal visualization material |
| Toon | string: Cel/toon shading material |
| Matcap | string: Material capture shading material |
| Lambert | string: Basic diffuse shading material |
| Phong | string: Specular Phong shading material |
Enum: TextureWrapping
Texture wrapping modes Enumeration of texture wrapping modes
| Field Name | Description |
|---|---|
| Repeat | string: Repeat texture beyond UV [0,1] range |
| ClampToEdge | string: Clamp texture coordinates to edge |
| MirroredRepeat | string: Repeat texture with mirroring |
Enum: MagFilter
Magnification filter modes Enumeration of texture magnification filter modes
| Field Name | Description |
|---|---|
| Linear | string: Linear interpolation filtering |
| Nearest | string: Nearest neighbor filtering |
Enum: MinFilter
Minification filter modes Enumeration of texture minification filter modes
| Field Name | Description |
|---|---|
| Nearest | string: Nearest neighbor filtering |
| NearestMipmapNearest | string: Nearest neighbor with nearest mipmap |
| NearestMipmapLinear | string: Nearest neighbor with linear mipmap |
| Linear | string: Linear interpolation filtering |
| LinearMipmapNearest | string: Linear interpolation with nearest mipmap |
| LinearMipmapLinear | string: Linear interpolation with linear mipmap (trilinear) |
Enum: WrapMode
Enumeration of available wrap modes.
| Field Name | Description |
|---|---|
| Repeat | string: Texture coordinates repeat |
| ClampToEdge | string: Texture coordinates clamp to edge |
| MirroredRepeat | string: Texture coordinates mirror and then repeat |
Enum: Anisotropy
Anisotropic filtering levels Enumeration of anisotropic filtering levels
| Field Name | Description |
|---|---|
| x1 | string: 1x anisotropy (disabled) |
| x2 | string: 2x anisotropic filtering |
| x4 | string: 4x anisotropic filtering |
| x8 | string: 8x anisotropic filtering |
| x16 | string: 16x anisotropic filtering |
Enum: BlendingMode
Blending modes Enumeration of material blending modes
| Field Name | Description |
|---|---|
| None | string: No blending (opaque) |
| Normal | string: Normal alpha blending |
| Additive | string: Additive blending |
| Subtractive | string: Subtractive blending |
| Multiply | string: Multiply blending |
| Custom | string: Custom blending equation |
Enum: BlendFactor
Blend factor sources Enumeration of blend factor sources
| Field Name | Description |
|---|---|
| Zero | string: Zero factor |
| One | string: One factor |
| SourceColor | string: Source color factor |
| OneMinusSourceColor | string: One minus source color factor |
| SourceAlpha | string: Source alpha factor |
| OneMinusSourceAlpha | string: One minus source alpha factor |
| DestinationAlpha | string: Destination alpha factor |
| OneMinusDestinationAlpha | string: One minus destination alpha factor |
| DestinationColor | string: Destination color factor |
| OneMinusDestinationColor | string: One minus destination color factor |
| SourceAlphaSaturate | string: Source alpha saturate factor (src only) |
Enum: BlendSource
Enumeration of available blend sources.
| Field Name | Description |
|---|---|
| Zero | string: zero source |
| One | string: one source |
| SourceColor | string: source color |
| OneMinusSourceColor | string: one minus source color |
| SourceAlpha | string: source alpha |
| OneMinusSourceAlpha | string: one minus source alpha |
| DestinationAlpha | string: destination alpha |
| OneMinusDestinationAlpha | string: one minus destination alpha |
| DestinationColor | string: destination color |
| OneMinusDestinationColor | string: one minus destination color |
| SourceAlphaSaturate | string: source alpha saturate |
Enum: BlendDest
Enumeration of available blend destinations. Similar to BlendSource, represents the possible blending destinations.
| Field Name | Description |
|---|---|
Enum: BlendEquation
Blend equations Enumeration of blend equations
| Field Name | Description |
|---|---|
| Add | string: Add source and destination |
| Subtract | string: Subtract destination from source |
| ReverseSubtract | string: Subtract source from destination |
| Min | string: Minimum of source and destination |
| Max | string: Maximum of source and destination |
Enum: CullingMode
Culling modes Enumeration of polygon culling modes
| Field Name | Description |
|---|---|
| Front | string: Cull front-facing polygons |
| Back | string: Cull back-facing polygons |
| Off | string: No polygon culling |
Enum: DepthMode
Depth test modes Enumeration of depth test comparison modes
| Field Name | Description |
|---|---|
| Never | string: Never pass depth test |
| Always | string: Always pass depth test |
| Less | string: Pass if depth is less |
| LessEqual | string: Pass if depth is less or equal |
| GreaterEqual | string: Pass if depth is greater or equal |
| Greater | string: Pass if depth is greater |
| NotEqual | string: Pass if depth is not equal |
Enum: NormalType
Normal map types Enumeration of normal map coordinate spaces
| Field Name | Description |
|---|---|
| TangentSpace | string: Tangent-space normal map |
| ObjectSpace | string: Object-space normal map |
Enum: SurfaceEnvironmentCombination
Environment combination modes Enumeration of environment map combination modes
| Field Name | Description |
|---|---|
| Multiply | string: Multiply surface color with environment |
| Mix | string: Mix between surface and environment using reflectivity |
| Add | string: Add environment to surface color |
Enum: SheenAttributes
Sheen attributes (for Physical materials) Enumeration of sheen material property names
| Field Name | Description |
|---|---|
| Sheen | string: Sheen intensity attribute name |
| SheenRoughness | string: Sheen roughness attribute name |
| SheenColor | string: Sheen color attribute name |
Enum: ClearcoatAttributes
Clearcoat attributes (for Physical materials) Enumeration of clearcoat material property names
| Field Name | Description |
|---|---|
| ClearcoatLevel | string: Clearcoat intensity attribute name |
| ClearcoatRoughness | string: Clearcoat roughness attribute name |
| ClearcoatNormalScale | string: Clearcoat normal scale attribute name |
Enum: TransmissionAttributes
Transmission attributes (for Physical materials) Enumeration of transmission material property names
| Field Name | Description |
|---|---|
| Transmission | string: Transmission intensity attribute name |
| IndexOfRefraction | string: Index of refraction attribute name |
Enum: SpecularAttributes
Specular attributes (common to multiple material types) Enumeration of specular material property names
| Field Name | Description |
|---|---|
| SpecularIntensity | string: Specular intensity attribute name |
| SpecularColor | string: Specular color attribute name |
| Shininess | string: Shininess attribute name (Phong only) |
| Reflectivity | string: Reflectivity attribute name |
Enum: EmissionAttributes
Emission attributes (common to multiple material types) Enumeration of emissive material property names
| Field Name | Description |
|---|---|
| EmissiveColor | string: Emission color attribute name |
| EmissiveIntensity | string: Emission intensity attribute name |
Enum: DisplacementAttributes
Displacement attributes (common to multiple material types) Enumeration of displacement mapping property names
| Field Name | Description |
|---|---|
| DisplacementScale | string: Displacement scale attribute name |
| DisplacementBias | string: Displacement bias attribute name |
Enum: AmbientOcclusionAttributes
Ambient occlusion attributes (common to multiple material types) Enumeration of ambient occlusion property names
| Field Name | Description |
|---|---|
| AmbientOcclusionIntensity | string: Ambient occlusion intensity attribute name |
Enum: LightmapAttributes
Lightmap attributes (common to multiple material types) Enumeration of lightmap property names
| Field Name | Description |
|---|---|
| LightMapIntensity | string: Lightmap intensity attribute name |
Enum: PointAttributes
Point rendering attributes Enumeration of point material property names
| Field Name | Description |
|---|---|
| PointSize | string: Point size attribute name |
| PointSizeAttenuation | string: Point size attenuation attribute name |
Enum: ToonAttributes
Toon shading attributes Enumeration of toon shading property names
| Field Name | Description |
|---|---|
| Gradient | string: Gradient ramp attribute name |
Enum: MatcapAttributes
Matcap shading attributes Enumeration of matcap shading property names
| Field Name | Description |
|---|---|
| Matcap | string: Matcap texture attribute name |
Enum: ShaderAttributes
Shader material attributes Enumeration of custom shader property names
| Field Name | Description |
|---|---|
| VertexShader | string: Vertex shader attribute name |
| PixelShader | string: Pixel shader attribute name |
Enum: BasicAttributes
Basic material attributes Enumeration of basic material property names
| Field Name | Description |
|---|---|
| EmissionColor | string: Emission color attribute name (Basic material) |
| RefractionRatio | string: Refraction ratio attribute name |
Enum: TextureAttributeType
Texture attribute types (for runtime checks) Enumeration of texture attribute types
| Field Name | Description |
|---|---|
| Albedo | string: Albedo/diffuse texture |
| Normal | string: Normal map texture |
| Roughness | string: Roughness map texture |
| Metalness | string: Metalness map texture |
| Emissive | string: Emissive texture |
| AmbientOcclusion | string: Ambient occlusion texture |
| Alpha | string: Alpha mask texture |
| SpecularMap | string: Specular map texture |
| SpecularIntensityMap | string: Specular intensity map |
| SpecularColorMap | string: Specular color map |
| SheenRoughnessMap | string: Sheen roughness map |
| SheenColorMap | string: Sheen color map |
| Clearcoat | string: Clearcoat texture |
| ClearcoatNormalMap | string: Clearcoat normal map |
| ClearcoatRoughnessMap | string: Clearcoat roughness map |
| TransmissionMap | string: Transmission map |
| Environment | string: Environment map (HDR) |
| ThicknessMap | string: Thickness map |
| Displacement | string: Displacement map |
| LightMap | string: Light map texture |
| Matcap | string: Matcap texture |
| Gradient | string: Gradient ramp texture |
Core Enumerations
Texture Enumerations
Rendering Enumerations
Material Property Enumerations
Attribute Enumerations
These tables group related attribute names for programmatic access: