title | description |
---|---|
PBR textures |
PBR textures are advanced textures using multiple texture maps. |
Physically-Based rendering (PBR) textures allow you to represent realistic shading and lighting by using multiple types of 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.
Various applications and workflows are available for creating PBR textures. You can use these during the modeling and texturing phases of custom 3D object creation, provided that Roblox Studio supports the specific texture maps you're using.
This guide provides instructions on setting up your mesh objects to use PBR texture maps, and describes common use-cases and best practices for Roblox's supported PBR texture maps. When creating your own surfaces, see Material references for common material values, image comparisons and clothing examples.
You can add PBR textures to any Class.MeshPart
by adding a Class.SurfaceAppearance
object which overwrites the original assigned texture. In general, you can't modify Class.SurfaceAppearance
properties by scripts during an experience because the engine requires some pre-processing to display these graphics. Similar to adding a basic texture, each texture image map must point to the appropriate uploaded image asset ID.
To enable surface appearance for a Class.MeshPart
:
-
In the Explorer window, hover over the
Class.MeshPart
and click the ⊕ button. -
Insert a SurfaceAppearance from the contextual menu.
When you are ready to add texture maps to your
Class.SurfaceAppearance
object, you can click each map property to browse and set the appropriate asset ID for each image:
Studio currently supports 4 types of PBR texture maps: Color, Normal, Metalness, Roughness. Each of these maps correspond to an important aspect of the object's surface appearance. Texture maps only change visual appearance and don't affect the geometry of the Class.MeshPart
object.
See the following examples for an overview of Roblox's supported texture maps and additional resources:
The `Class.SurfaceAppearance.ColorMap|ColorMap` property sets the color data of the surface, including any transparency present in the map. See [Color (albedo)](#color-albedo) for additional information. Example map Example mesh Mesh and texture The `Class.SurfaceAppearance.NormalMap|NormalMap` texture property defines the topography of the surface allowing you to add visual textures such as bumps, dents, or cracks to your surface. See [Normal](#normal) for additional information. Example map Example mesh Mesh and texture The grayscale `Class.SurfaceAppearance.RoughnessMap|RoughnessMap` texture property defines the smoothness of the surface, allowing for a glossy or matte visual appearance. See [Roughness](#roughness) for additional information. Example map Example mesh Mesh and texture The grayscale `Class.SurfaceAppearance.MetalnessMap|MetalnessMap` texture property defines the metallic visual properties of the surface. See [Metalness](#metalness) for additional information. Example map Example mesh Mesh and texture For technical details on texture file requirements, see [texture requirements](../../art/modeling/texture-specifications.md).The color, or albedo, map determines the color of your texture and consists of mostly color information with little to no lighting or textural information. For additional customization, you can also add transparency in your albedo texture by adding opacity to your image map.
While albedo maps and generic [non-PBR texture maps](../../parts/textures-decals.md), commonly known as **diffuse maps**, contain very similar base color data for a surface, diffuse maps often include shading and lighting values to imitate a specific visual element that are more effectively handled by PBR's [normal](#normal), [roughness](#roughness), and [metalness](#metalness) maps. Using a typical diffuse map instead of an albedo map may often look incorrect when the lighting doesn't match with these added baked-in texture elements.For objects that require partial or complete sections of transparency, such as grass, leaves, lace, or decals like dirt or grunge, you can use various alpha modes to apply transparency to your color map. If your color map image format supports alpha channels, you can apply a grayscale alpha map where 0.0 is opaque and 1.0 is transparent. Similarly, when using an image format such as a .png
, any opacity on the color map applies as transparency on the asset.
You can apply transparency in two different behaviors by setting the following Class.SurfaceAppearance.AlphaMode|AlphaMode
values:
- Overlay — Overlays the
Class.SurfaceAppearance.ColorMap|ColorMap
over the underlying mesh'sClass.MeshPart.Color
. Color maps using Overlay reveal the base color of the mesh anywhere transparency is present. This is the default setting. - Transparency — Removes the visible mesh based on transparency in the
ColorMap
. This renders the mesh see-through and does not reveal the original mesh color whenever transparency is present.
You can use Overlay to reveal sections of the mesh's original color. Since the transparent areas of the color map expose the underlying color, you can design a unique texture map that partially or fully reveals the mesh's Class.MeshPart.Color|Color
property for custom skin tones or other situations with unique colors.
The following example demonstrates how the Overlay mode works using a white sphere reference:
Example color/albedo map with transparency Example mesh object (white) `Class.SurfaceAppearance.AlphaMode|AlphaMode` set to **Overlay** using reference map and materialThe following example uses the Overlay mode for custom characters, revealing the character's original skin-tone:
Color map containing transparency in sections to expose the original mesh color Several variations of characters with a single color map using **Overlay** modeSee Custom skin tone for additional details on optimizing an overlay for skin and similar applications.
You can use the Transparency mode to create complex or extremely fine objects, such as lace or netting, by removing visible parts of the mesh as an alternative to sculpting the mesh geometry. Since this does not affect the geometry of the mesh object, this can allow you to create detailed objects without the performance impact of an intricate mesh model.
The following example demonstrates how a partial and full transparency in this mode visually removes sections of the mesh:
No transparency Half transparency in sections Full transparency in sections No transparency Half transparency in sections Full transparency in sectionsYou can apply a tint to your color map by modifying the Class.SurfaceAppearance.Color
property. Tinting does not affect performance and you can save on memory by reusing a single ColorMap with different tints. Use color tinting to create additional low-cost variation between your Class.MeshPart
PBR textures or to programmatically modify your PBR surface colors in real-time.
Class.SurfaceAppearance.Color
tinting applies as a multiplier, so the final appearance is a function of Datatype.Color3
(texel color) times Class.SurfaceAppearance.Color
. This means that authoring your original Class.SurfaceAppearance.ColorMap
in near-white grayscale colors creates the strongest tinting effect when this property is applied.
Tinting only applies to the Class.SurfaceAppearance.ColorMap
and not the Class.MeshPart.Color
. You can continue to use alpha channels when applying transparency. When Class.SurfaceAppearance.AlphaMode
is set to Overlay
and an alpha channel is present, the underlying Class.MeshPart.Color
is revealed and Class.SurfaceAppearance.Color
tinting only applies to the visible Class.SurfaceAppearance
color map.
The normal, or surface, map adds texture depth to your surface and behaves similarly to a height map. As a result, the effect may fade or intensify depending on the viewing angle and lighting environment. When a normal map is not present, the value is set to 0.0.
In the following figure, you can switch between the mesh reference and the map reference for comparisons of normal map values:
0.0 0.5 1.0 0.0 0.5 1.0The R, G, and B channels of the image correspond respectively to the X, Y, and Z components of the local surface vector. A uniform image of color [127, 127, 255] translates to a completely flat normal map. Roblox only supports OpenGL format - Tangent Space normal maps.
Normal maps prominently affect the visual surface of a mesh and can accentuate awkward seams in your texture. Whenever possible, keep your texture seams hidden to avoid visual issues with your mesh.
Roughness, or microsurface, maps determine how light is spread across your model's surface. When roughness is at 0.0, the surface doesn't scatter light at all, resulting in a much sharper and brighter reflection and glossiness on your material. At 1.0, light and reflections evenly scatter over the model resulting in a less reflective matte-like surface.
Roughness may impact how reflective an object is at different angles, referred to as the Fresnel effect. See Fresnel for more details and best-practices to maintain consistent reflective behavior.
See the following figure for comparisons of various roughness map values:
0.0 0.5 1.0 Various combinations of the roughness and metalness can represent almost every possible real-world material surface. See [Material References](../../art/modeling/material-reference.md) for examples and references of how combinations of material values can create various surface appearances.Fresnel refers to the amount of reflection of a surface in reference to the current viewing angle. Studio's Fresnel processing aims for physical real-world accuracy, although you may get unexpected specular contribution at certain angles even with rough surfaces. In some cases, you can compensate by making your roughness map around 0.1 more rough to achieve a consistent lighting response with your materials.
Even though Roblox renders this lighting effect accurately, the brightness and reflectivity of a surface may not respond consistently between your texture content creating software, such as Substance Painter, and Studio. See Clothing examples for differences in rendering between applications.
Metalness determines the reflectivity of a surface. Metalness values range between 0.0 and 1.0. Roblox sets the default value to 0.0 if a metalness map is not present.
See the following figure for comparisons of various metalness map values:
0.0 0.5 1.0Different PBR renderers use various workflows for processing reflectiveness. Studio only uses the metalness workflow which determines whether a material is a nonmetal or a metal, sometimes referred to as an insulator or conductor.
In most cases, you should set this value to either 0.0 (non-metal) or 1.0 (metal). You can use partial metalness values when creating more uncommon surfaces with moderate reflective properties, like satin or silk. This practice can subtly fake the reflections in the material to highlight the color from the color/albedo map over colors reflected in the environment.
Various combinations of the roughness and metalness can represent almost every possible real-world material surface. See [Material references](../../art/modeling/material-reference.md) for examples and references of how combinations of material values can create various surface appearances.