MaterialVariant
Represent a variant of a Material.
Memory category | Instances |
---|
Member index 11
Description
Using MaterialVariant objects can expand the variety of materials in an experience. MaterialVariant has properties that can define the appearance of a material. Its name can be set in MaterialService to globally override a built-in material, or set in the BasePart.MaterialVariant property to change certain Parts. MaterialVariant objects only work as descendants of MaterialService.
History 26
- 645 Change ValueType of from Content to ContentId
- 645 Change ValueType of RoughnessMap from Content to ContentId
- 645 Change ValueType of NormalMap from Content to ContentId
- 645 Change ValueType of MetalnessMap from Content to ContentId
- 645 Change ValueType of ColorMap from Content to ContentId
- 587 Change ReadSecurity of BaseMaterial from PluginSecurity to None
- 553 Add
- 553 Change Default of StudsPerTile from to 10
- 553 Change Default of MaterialPattern from to Regular
- 553 Change Default of CustomPhysicalProperties from to PhysicalProperties(default)
- 553 Change Default of BaseMaterial from to Plastic
- 553 Add
- 553 Add
- 538 Add CustomPhysicalProperties
- 534 Change Tags of MaterialVariant from [NotBrowsable] to []
- 522 Change Category of MaterialPattern from Appearance For Terrain to Appearance
- 512 Change Category of StudsPerTile from Appearance For Part to Appearance
- 505 Change Category of StudsPerTile from Appearance to Appearance For Part
- 505 Add MaterialPattern
- 494 Add StudsPerTile
- 494 Add RoughnessMap
- 494 Add NormalMap
- 494 Add MetalnessMap
- 494 Add ColorMap
- 494 Add BaseMaterial
- 494 Add MaterialVariant
Members 11
BaseMaterial
Type | Default | |
---|---|---|
Material | Plastic |
Category Material this variant belongs to.
Write security | PluginSecurity |
---|---|
Thread safety | ReadSafe |
Category | Appearance |
Loaded/Saved | true |
History 3
- 587 Change ReadSecurity of BaseMaterial from PluginSecurity to None
- 553 Change Default of BaseMaterial from to Plastic
- 494 Add BaseMaterial
ColorMap
Type | Default | |
---|---|---|
ContentId |
This property determines the color of the surface. This texture is sometimes called the albedo texture. The alpha channel is not used.
Security | PluginSecurity |
---|---|
Thread safety | ReadSafe |
Category | Appearance |
Loaded/Saved | true |
CustomPhysicalProperties
Type | Default | |
---|---|---|
PhysicalProperties | default |
Thread safety | ReadSafe |
---|---|
Category | Material |
Loaded/Saved | true |
History 2
- 553 Change Default of CustomPhysicalProperties from to PhysicalProperties(default)
- 538 Add CustomPhysicalProperties
MaterialPattern
Type | Default | |
---|---|---|
MaterialPattern | Regular |
Determines texture tiling method.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
History 3
- 553 Change Default of MaterialPattern from to Regular
- 522 Change Category of MaterialPattern from Appearance For Terrain to Appearance
- 505 Add MaterialPattern
MetalnessMap
Type | Default | |
---|---|---|
ContentId |
This property determines which parts of the surface are metal and are non-metal. A metalness map is a grayscale image where black pixels correspond to non-metals and white pixels correspond to metals.
Metals only reflect light the same color as the metal, and they reflect much more light than non-metals. Most materials in the real world can be categorized either metals or non-metals. For this reason, most pixels in a metalness map will be either pure black or pure white. Values in between are typically used to simulate dirt or grunge on top of an underlying metal area.
When Lighting.EnvironmentSpecularScale is 0, metalness has no effect. For the most realistic reflections, setting EnvironmentSpecularScale and Lighting.EnvironmentDiffuseScale to 1, and Lighting.Ambient and Lighting.OutdoorAmbient to (0,0,0) is recommended.
Security | PluginSecurity |
---|---|
Thread safety | ReadSafe |
Category | Appearance |
Loaded/Saved | true |
History 2
- 645 Change ValueType of MetalnessMap from Content to ContentId
- 494 Add MetalnessMap
NormalMap
Type | Default | |
---|---|---|
ContentId |
This property modifies the lighting of the surface by adding bumps, dents, cracks, and curves without adding more polygons.
Normal maps are RGB images that modify the surface's normal vector used for lighting calculations. The R, G, and B channels of the NormalMap correspond to the X, Y, and Z components of the local surface vector respectively, and byte values of 0 and 255 for each channel correspond linearly to normal vector components of -1 and 1.016 respectively. This range is stretched slightly from -1 to 1 so that a byte value of 127 maps to exactly 0. The normal vector's Z axis is always defined as the direction of the underlying mesh's normal. A uniform (127,127,255) image translates to a completely flat normal map where the normal is everywhere perpendicular to the mesh surface. This format is called "tangent space" normal maps. Roblox does not support world space or object space normal maps.
Incorrectly flipped normal components can make bumps appear like indents. If you import a normal map and notice the lighting looks off, you may need to invert the G channel of the image. The X and Y axes of the tangent space frame correspond to the X and Y directions in the image after it's transformed by the mesh UVs. If you view your normal map in an image editor as if it were displayed on a surface, normals pointing towards the right side of the screen should appear more red, and normals pointing towards the top side of your screen should appear more green.
The terms "DirectX format" and "OpenGL format" are sometimes used to describe whether the G channel of the normal map is inverted or not. Roblox expects the OpenGL format.
Roblox expects imported meshes to include tangents. Modeling software may also refer to this as "tangent space" information. If you apply a normal map and it does not seem to make any visual difference, you may need to re-export your mesh along with its tangent information from modeling software.
Security | PluginSecurity |
---|---|
Thread safety | ReadSafe |
Category | Appearance |
Loaded/Saved | true |
RoughnessMap
Type | Default | |
---|---|---|
ContentId |
This property determines the apparent roughness across the surface. A roughness map is a grayscale image where black pixels correspond to a maximally smooth surface, and white pixels correspond to a maximally rough surface.
Roughness refers to how much variation the surface has on a very small scale. Reflections on smooth surfaces are sharp and concentrated. Reflections on rough surfaces are more blurry and dispersed.
Security | PluginSecurity |
---|---|
Thread safety | ReadSafe |
Category | Appearance |
Loaded/Saved | true |
History 2
- 645 Change ValueType of RoughnessMap from Content to ContentId
- 494 Add RoughnessMap
StudsPerTile
Type | Default | |
---|---|---|
float | 10 |
Determines the scale of textures. Larger values for this property will lead to the textures appearing larger, and repeating less frequently.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
History 4
- 553 Change Default of StudsPerTile from to 10
- 512 Change Category of StudsPerTile from Appearance For Part to Appearance
- 505 Change Category of StudsPerTile from Appearance to Appearance For Part
- 494 Add StudsPerTile