SurfaceAppearance
An object that allows developers to override the appearance of a MeshPart with advanced graphics options.
Memory category | Instances |
---|
Member index 7
Description
SurfaceAppearance objects let you override the appearance of a MeshPart with advanced graphics options. Most notably, it can apply a set of Physically‑Based Rendering (PBR) texture images, or maps, on a single object. Combining multiple texture maps can more accurately simulate color, roughness, and reflectivity in any lighting environment and can enhance the visual elements of your assets and environment; see PBR Textures for more details.
Appearance of this object on a MeshPart depends on the user's device and graphics quality level. For best results, you may want to preview your content with different quality level settings.
Note that most SurfaceAppearance properties cannot be modified by scripts, as the necessary pre-processing is usually too expensive during runtime.
History 45
- 645 Change ValueType of TexturePack 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
- 623 Add Color
- 553 Change Default of AlphaMode from to Overlay
- 530 Change Tags of TexturePack from [Hidden] to []
- 520 Change WriteSecurity of RoughnessMap from LocalUserSecurity to PluginSecurity
- 520 Change ReadSecurity of RoughnessMap from LocalUserSecurity to PluginSecurity
- 520 Change WriteSecurity of NormalMap from LocalUserSecurity to PluginSecurity
- 520 Change ReadSecurity of NormalMap from LocalUserSecurity to PluginSecurity
- 520 Change WriteSecurity of MetalnessMap from LocalUserSecurity to PluginSecurity
- 520 Change ReadSecurity of MetalnessMap from LocalUserSecurity to PluginSecurity
- 520 Change WriteSecurity of ColorMap from LocalUserSecurity to PluginSecurity
- 520 Change ReadSecurity of ColorMap from LocalUserSecurity to PluginSecurity
- 520 Change WriteSecurity of AlphaMode from LocalUserSecurity to PluginSecurity
- 520 Change ReadSecurity of AlphaMode from LocalUserSecurity to PluginSecurity
- 486 Change ThreadSafety of TexturePack from ReadOnly to ReadSafe
- 486 Change ThreadSafety of RoughnessMap from ReadOnly to ReadSafe
- 486 Change ThreadSafety of NormalMap from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MetalnessMap from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ColorMap from ReadOnly to ReadSafe
- 486 Change ThreadSafety of AlphaMode from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TexturePack from to ReadOnly
- 462 Change ThreadSafety of RoughnessMap from to ReadOnly
- 462 Change ThreadSafety of NormalMap from to ReadOnly
- 462 Change ThreadSafety of MetalnessMap from to ReadOnly
- 462 Change ThreadSafety of ColorMap from to ReadOnly
- 462 Change ThreadSafety of AlphaMode from to ReadOnly
- 438 Change ReadSecurity of TexturePack from LocalUserSecurity to RobloxSecurity
- 438 Change Tags of TexturePack from [] to [Hidden]
- 438 Change WriteSecurity of TexturePack from LocalUserSecurity to RobloxSecurity
- 438 Change WriteSecurity of AlphaMode from RobloxSecurity to LocalUserSecurity
- 438 Change ReadSecurity of AlphaMode from RobloxSecurity to LocalUserSecurity
- 438 Change Tags of SurfaceAppearance from [Deprecated] to []
- 432 Add TexturePack
- 432 Change ReadSecurity of AlphaMode from None to RobloxSecurity
- 432 Change WriteSecurity of AlphaMode from None to RobloxSecurity
- 422 Add RoughnessMap
- 422 Add NormalMap
- 422 Add MetalnessMap
- 422 Add ColorMap
- 422 Add AlphaMode
- 422 Add SurfaceAppearance
Members 7
AlphaMode
Type | Default | |
---|---|---|
AlphaMode | Overlay |
This property determines how the alpha channel of the SurfaceAppearance.ColorMap is used.
When set to Transparency and the MeshPart.Transparency is set to 0, opaque pixels in the SurfaceAppearance.ColorMap will render as completely opaque in the 3D scene. This solves various problems for textures with different transparent and opaque areas, such as foliage. When parts of the surface are fully opaque, the Roblox engine can render them with proper depth-based occlusion. Opaque surfaces also generally work better with depth-based effects like DepthOfFieldEffect, glass and water refraction, and water reflection.
See here for more information.
Security | PluginSecurity |
---|---|
Thread safety | ReadSafe |
Category | Appearance |
Loaded/Saved | true |
History 10
- 553 Change Default of AlphaMode from to Overlay
- 520 Change WriteSecurity of AlphaMode from LocalUserSecurity to PluginSecurity
- 520 Change ReadSecurity of AlphaMode from LocalUserSecurity to PluginSecurity
- 486 Change ThreadSafety of AlphaMode from ReadOnly to ReadSafe
- 462 Change ThreadSafety of AlphaMode from to ReadOnly
- 438 Change WriteSecurity of AlphaMode from RobloxSecurity to LocalUserSecurity
- 438 Change ReadSecurity of AlphaMode from RobloxSecurity to LocalUserSecurity
- 432 Change ReadSecurity of AlphaMode from None to RobloxSecurity
- 432 Change WriteSecurity of AlphaMode from None to RobloxSecurity
- 422 Add AlphaMode
Color
Type | Default | |
---|---|---|
Color3 | 1, 1, 1 |
Applies a tint to your existing colormap. Set directly with color picker or programmatically with Color3.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
ColorMap
Type | Default | |
---|---|---|
ContentId |
This property determines the color and opacity of the surface. This texture is sometimes called the albedo texture. The alpha channel of this texture controls its opacity, which behaves differently based on the SurfaceAppearance.AlphaMode setting.
See here for more information.
Security | PluginSecurity |
---|---|
Thread safety | ReadSafe |
Category | Appearance |
Loaded/Saved | true |
History 6
- 645 Change ValueType of ColorMap from Content to ContentId
- 520 Change WriteSecurity of ColorMap from LocalUserSecurity to PluginSecurity
- 520 Change ReadSecurity of ColorMap from LocalUserSecurity to PluginSecurity
- 486 Change ThreadSafety of ColorMap from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ColorMap from to ReadOnly
- 422 Add ColorMap
MetalnessMap
Type | Default | |
---|---|---|
ContentId |
This property determines which parts of the surface are metal or non-metal. The 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 pixels in a metalness map will be either pure black or pure white, while values in between can be 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, it's recommended to set
Lighting.EnvironmentSpecularScale and
Lighting.EnvironmentDiffuseScale to 1, as well as
Lighting.Ambient and Lighting.OutdoorAmbient to
(0, 0, 0)
.
See here for more information.
Security | PluginSecurity |
---|---|
Thread safety | ReadSafe |
Category | Appearance |
Loaded/Saved | true |
History 6
- 645 Change ValueType of MetalnessMap from Content to ContentId
- 520 Change WriteSecurity of MetalnessMap from LocalUserSecurity to PluginSecurity
- 520 Change ReadSecurity of MetalnessMap from LocalUserSecurity to PluginSecurity
- 486 Change ThreadSafety of MetalnessMap from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MetalnessMap from to ReadOnly
- 422 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. The normal map is an RGB image that modifies the surface's normal vector used for lighting calculations. Its R, G, and B channels 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 referred to as a "tangent space"
normal map. Note that 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 also 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 the modeling software.
See here for more information.
Security | PluginSecurity |
---|---|
Thread safety | ReadSafe |
Category | Appearance |
Loaded/Saved | true |
History 6
- 645 Change ValueType of NormalMap from Content to ContentId
- 520 Change WriteSecurity of NormalMap from LocalUserSecurity to PluginSecurity
- 520 Change ReadSecurity of NormalMap from LocalUserSecurity to PluginSecurity
- 486 Change ThreadSafety of NormalMap from ReadOnly to ReadSafe
- 462 Change ThreadSafety of NormalMap from to ReadOnly
- 422 Add NormalMap
RoughnessMap
Type | Default | |
---|---|---|
ContentId |
This property determines the apparent roughness across the surface. The roughness map is a grayscale image where black pixels correspond to a maximally smooth surface, and white pixels correspond to a maximally rough surface.
Note that surface roughness works on a very small scale. Reflections on smooth surfaces are sharp and concentrated, while reflections on rough surfaces are more blurry and dispersed.
See here for more information.
Security | PluginSecurity |
---|---|
Thread safety | ReadSafe |
Category | Appearance |
Loaded/Saved | true |
History 6
- 645 Change ValueType of RoughnessMap from Content to ContentId
- 520 Change WriteSecurity of RoughnessMap from LocalUserSecurity to PluginSecurity
- 520 Change ReadSecurity of RoughnessMap from LocalUserSecurity to PluginSecurity
- 486 Change ThreadSafety of RoughnessMap from ReadOnly to ReadSafe
- 462 Change ThreadSafety of RoughnessMap from to ReadOnly
- 422 Add RoughnessMap
TexturePack
Type | Default | |
---|---|---|
ContentId |
Security | RobloxSecurity |
---|---|
Thread safety | ReadSafe |
Category | Appearance |
Loaded/Saved | true |
History 8
- 645 Change ValueType of TexturePack from Content to ContentId
- 530 Change Tags of TexturePack from [Hidden] to []
- 486 Change ThreadSafety of TexturePack from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TexturePack from to ReadOnly
- 438 Change ReadSecurity of TexturePack from LocalUserSecurity to RobloxSecurity
- 438 Change Tags of TexturePack from [] to [Hidden]
- 438 Change WriteSecurity of TexturePack from LocalUserSecurity to RobloxSecurity
- 432 Add TexturePack