Skip to content

Latest commit

 

History

History
349 lines (287 loc) · 23.4 KB

surface-appearance.md

File metadata and controls

349 lines (287 loc) · 23.4 KB
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.

A humanoid avatar with dreadlocks, a glossy jacket, jeans with decals, and boots.

A humanoid avatar with a short haircut, leather jacket, capri pants, and orange shoes.

A realistic leafy bush

A realistic mossy rock

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.

Enable surface appearance

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:

  1. In the Explorer window, hover over the Class.MeshPart and click the ⊕ button.

  2. Insert a SurfaceAppearance from the contextual menu.

    A SurfaceAppearance object parented within a MeshPart in Studio's Explorer window.

    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:

    A close-up of the Properties window where the user selected the ColorMap property. A popup displays all available image textures to select.

Texture maps

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.

Avoid adjusting material values to look better in one specific lighting situation. You should base your material values on the physical characteristics and test and iterate to achieve a result that remains visually accurate in various lighting environments.

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.

A completely filled image, mostly red with various black splotches and white scratches.

Example map

A blank white sphere with a dark background.

Example mesh

A red sphere with black splotches and white scratches with a dark background.

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.

A completely filled image, mostly cyan with streaks and bumps across the surface giving the impression of a tactile surface.

Example map

A blank teal sphere with a dark background.

Example mesh

A teal sphere with tactile streaks and bumps across the surface.

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.

A completely filled image of black diamond shapes over a light grey background.

Example map

A blank purple sphere with a dark background.

Example mesh

A purple sphere that has glossy diamond shapes over its surface.

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.

A completely filled image with a completely black border and scratch-like streaks revealing a white center.

Example map

A blank light blue sphere with a dark background.

Example mesh

A light blue sphere with parts of its surface looking scratched. The scratched areas reveal a metal-ness quality that is more reflective.

Mesh and texture For technical details on texture file requirements, see [texture requirements](../../art/modeling/texture-specifications.md).

Color (albedo)

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.

Alpha modes

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's Class.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.
Overlay

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:

A completely filled image of a semi-repeating pattern with 8 by 8 small light blue squares. The background is checkered to indicate transparency.

Example color/albedo map with transparency

A blank white sphere over a dark background.

Example mesh object (white)

A white sphere with small blue squares scattered over the surface.

`Class.SurfaceAppearance.AlphaMode|AlphaMode` set to **Overlay** using reference map and material

The following example uses the Overlay mode for custom characters, revealing the character's original skin-tone:

A completely filled image of a texture map for a 3D humanoid model. Various parts of the image is checkered or partially checkered to indicate varying levels of transparency.

Color map containing transparency in sections to expose the original mesh color

Four of the same humanoid models with different skin tones: light brown, black, white, dark green.

Several variations of characters with a single color map using **Overlay** mode

See Custom skin tone for additional details on optimizing an overlay for skin and similar applications.

Transparency

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:

A sphere with a basket-like surface.

No transparency

A sphere with regular triangular patterns on its surface partially invisible.

Half transparency in sections

A sphere with regular triangular patterns on its surface completely invisible.

Full transparency in sections

A completely filled image of a thatched basket-like surface.

No transparency

A completely filled image with a thatched basket-like surface with a regular triangle pattern partially transparent.

Half transparency in sections

A completely filled image with a thatched basket-like surface with a regular triangle pattern fully transparent.

Full transparency in sections

Color tinting

You 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.

A statue with a default yellow tint and reflective jade-like properties.

An statue mesh object from [The Mystery of Duvall Drive](../../resources/the-mystery-of-duvall-drive/index.md) experience with no tinting.

A statue with a red tint and continues to have a shiny reflective properties from its other texture maps.

Statue mesh with `SurfaceAppearance.Color` set to red.

A statue with a green tint and continues to have a shiny reflective properties from its other texture maps.

Statue mesh with `SurfaceAppearance.Color` set to green.

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.

Normal

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:

A clay colored smooth sphere.

0.0

A clay colored sphere with a moderately rocky surface.

0.5

A clay colored sphere with an extremely rocky surface

1.0

A completely filled teal image.

0.0

A completely filled teal image with a moderate amount of surface aberrations in slightly lighter and darker shades

0.5

A completely filled teal image with a heavy amount of surface aberrations in slightly lighter and darker shades

1.0

The 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

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:

A blue glossy sphere with a legend indicating the roughness map is completely black.

0.0

A blue semi-glossy sphere with a legend indicating the roughness map is exactly grey.

0.5

A blue matte sphere with a legend indicating the roughness map is completely white.

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

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

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:

A brown sphere with light splotches. A legend indicates the metalness map is completely black.

0.0

A brown sphere with light splotches and some reflectiveness. A legend indicates the metalness map is exactly grey.

0.5

A brown sphere with moderate splotches and lots of reflectiveness. A legend indicates the metalness map is completely white.

1.0

Different 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.