ModelData:getMaterial
EditReturns a table with all of the properties of a material.
Arguments
Name | Type | Description |
index | number | The index of a material. |
Returns
Name | Type | Description |
properties | table | The material properties. |
.color | table |
The color of the material. The table contains the r , g , b , and a components of the color, from 0 to 1.
|
.glow | table |
The glow color of the material (sometimes called emissive). The table contains the r , g , and b components of the color from 0 to 1, and a fourth number indicating the strength of the glow.
|
.uvShift | table | A table with 2 numbers indicating an offset to apply to UVs. |
.uvScale | table | A table with 2 numbers indicating a scale to apply to UVs. By default, shaders apply the UV scale before the UV offset. |
.metalness | number | The metalness parameter of the material. This is typically 0 or 1. By default, shaders multiply this property with the value from the metalness texture (when present) to get the final metalness used for shading. |
.roughness | number | The roughness parameter of the material. By default, shaders multiply this property with the value from the roughness texture (when present) to get the final roughness used for shading. |
.clearcoat | number | The clearcoat parameter of the material. |
.clearcoatRoughness | number | The roughness of the clearcoat layer. |
.occlusionStrength | number | A number multiplied by the value from the ambient occlusion texture to control how strong the occlusion effect is. |
.normalScale | number | A number multiplied by the value from the normal texture to control how strong the normal mapping effect is. |
.alphaCutoff | number | If a pixel has an alpha value less than the alpha cutoff, it will be discarded, which prevents it from occluding things behind it. This is sometimes called "holepunch" or "cutout" alpha. It's useful for textures with transparency. |
.texture | number | The index of the Image used for the color texture. |
.glowTexture | number | The index of the Image used for the glow texture. |
.occlusionTexture | number | The index of the Image used for the ambient occlusion texture. The red channel of the texture is used for ambient occlusion, allowing multiple parameters to use the same texture. |
.metalnessTexture | number | The index of the Image used for the metalness texture. The blue channel of the texture is used for metalness, allowing multiple parameters to use the same texture. |
.roughnessTexture | number | The index of the Image to use for the roughness texture. The green channel of the texture is used for roughness, allowing multiple parameters to use the same texture. |
.clearcoatTexture | number | The index of the Image to use for the clearcoat texture. The red channel of the texture is used for the clearcoat parameter, allowing multiple parameters to use the same texture. |
.normalTexture | number | The index of the Image to use for the normal map. |
Arguments
Name | Type | Description |
name | string | The name of a material. |
Returns
Name | Type | Description |
properties | table | The material properties. |
.color | table |
The color of the material. The table contains the r , g , b , and a components of the color, from 0 to 1.
|
.glow | table |
The glow color of the material (sometimes called emissive). The table contains the r , g , and b components of the color from 0 to 1, and a fourth number indicating the strength of the glow.
|
.uvShift | table | A table with 2 numbers indicating an offset to apply to UVs. |
.uvScale | table | A table with 2 numbers indicating a scale to apply to UVs. By default, shaders apply the UV scale before the UV offset. |
.metalness | number | The metalness parameter of the material. This is typically 0 or 1. By default, shaders multiply this property with the value from the metalness texture (when present) to get the final metalness used for shading. |
.roughness | number | The roughness parameter of the material. By default, shaders multiply this property with the value from the roughness texture (when present) to get the final roughness used for shading. |
.clearcoat | number | The clearcoat parameter of the material. |
.clearcoatRoughness | number | The roughness of the clearcoat layer. |
.occlusionStrength | number | A number multiplied by the value from the ambient occlusion texture to control how strong the occlusion effect is. |
.normalScale | number | A number multiplied by the value from the normal texture to control how strong the normal mapping effect is. |
.alphaCutoff | number | If a pixel has an alpha value less than the alpha cutoff, it will be discarded, which prevents it from occluding things behind it. This is sometimes called "holepunch" or "cutout" alpha. It's useful for textures with transparency. |
.texture | number | The index of the Image used for the color texture. |
.glowTexture | number | The index of the Image used for the glow texture. |
.occlusionTexture | number | The index of the Image used for the ambient occlusion texture. The red channel of the texture is used for ambient occlusion, allowing multiple parameters to use the same texture. |
.metalnessTexture | number | The index of the Image used for the metalness texture. The blue channel of the texture is used for metalness, allowing multiple parameters to use the same texture. |
.roughnessTexture | number | The index of the Image to use for the roughness texture. The green channel of the texture is used for roughness, allowing multiple parameters to use the same texture. |
.clearcoatTexture | number | The index of the Image to use for the clearcoat texture. The red channel of the texture is used for the clearcoat parameter, allowing multiple parameters to use the same texture. |
.normalTexture | number | The index of the Image to use for the normal map. |
Notes
All images are optional and may be nil
.