Skip to content

Latest commit

 

History

History
173 lines (132 loc) · 10.9 KB

meshes.md

File metadata and controls

173 lines (132 loc) · 10.9 KB
title description
Meshes
Meshes are a collection of vertices, edges, and faces that make up 3D objects.

Class.MeshPart objects are descendants of the Class.BasePart class. They represent meshes, which are collections of vertices, edges, and faces that make up a 3D object. Unlike parts, which you can directly create in Studio, you need to use a third-party modeling application like Blender or Maya to create meshes, then import them into Studio as Class.MeshPart objects.

After importing a mesh into Studio, you can customize its rendering properties, such as textures, level of detail, and collision fidelity. In addition to importing your own meshes, you can also browse and select from user-uploaded meshes using the Creator Store.

Roblox supports many types of meshes, as long as they adhere to the general mesh specifications. A basic mesh consists of at least one mesh object and one texture:

A mesh object sets the shape and geometry of the 3D object

A texture image map applies a surface appearance and color

The mesh and texture combine to make a unique custom 3D object

Studio also supports meshes with components for creating avatar character models or accessories, such as rigging and skinning data.

You can sell `Class.MeshPart` assets as avatar bodies, accessories, and clothing on the Marketplace. See [Avatar](../avatar/index.md) for more information.

Importing Meshes

You can import meshes into Studio using the 3D Importer. With this tool, you can preview and examine meshes before importing them into your workspace or Toolbox, such as verifying texture, rigging, skinning, and animation data. It also flags issues and rejects meshes with error.

If the mesh file you are importing contains objects using specific naming conventions or contains facial animation data, the 3D Importer automatically detects and converts them into the following objects instead of Class.MeshPart:

  • Class.Attachment: Objects with _Att at the end of their names.
  • Class.WrapTarget: Objects with _OuterCage at the end of their names.
  • Class.WrapLayer: Objects with both _InnerCage _OuterCage at the end of their names.
  • Class.FaceControls: Objects containing avatar character heads and the appropriate facial animation data.

If you want to bulk-import meshes along with non-3D assets, such as images and audio, you can use the Asset Manager. However, the Asset Manager doesn't support importing meshes with rigging, skinning, and animation data, accessories, or characters with facial animations.

Customizing Meshes

Unlike basic parts, meshes have more customization options that you can adjust for advanced rendering fidelity.

Texture

Textures determine the visual appearance of meshes. Studio allows you to either apply one texture using the Class.MeshPart.TextureID property, or apply up to four Physically-Based Rendering (PBR) textures within a Class.SurfaceAppearance or Class.MaterialVariant child object of the mesh. PBR textures allow you to represent realistic shading and lighting by using multiple types of texture images, or maps, on a single object.

Studio supports four PBR texture maps, each corresponding to a visual characteristic of an object's surface appearance. Combining multiple texture maps can more accurately simulate color, roughness, and reflectivity in any lighting environment, and enhance the visual elements of your assets and environment. For more information on PBR textures and the texture maps, see [PBR Textures](../art/modeling/surface-appearance.md).

You can apply PBR textures using one of the following objects:

  • Class.SurfaceAppearance: Applies PBR textures to the mesh surface and doesn't affect its geometry.
  • Class.MaterialVariant: Represents a custom material that not only applies PBR textures to the mesh surface but also adds physical properties.

To add PBR textures to a mesh:

  1. In the Explorer window, hover over the MeshPart object. Click the button and select SurfaceAppearance or MaterialVariant.

  2. In the Properties window, edit the properties corresponding to the PBR texture maps.

If you add both `Class.SurfaceAppearance` and `Class.MaterialVariant` as child objects of a mesh, Studio only applies the texture map settings of the `Class.SurfaceAppearance` object to the mesh. The mesh still has all other settings of the `Class.MaterialVariant` object, such as custom physical properties. If the mesh you import to Studio doesn't come with texture data, or you want to change the existing texture, use the following steps to add a single texture:
  1. Import the texture file to Asset Manager. The file must follow the texture specifications. Upon completion, Studio automatically assigns and prompts an asset ID.
  2. Copy the asset ID.
  3. In the Explorer window, select the MeshPart object.
  4. In the Properties window, select the TextureID field and paste the asset ID of the texture.
If your mesh has existing PBR textures, setting a Texture ID can't override the PBR textures.

Level of Detail

Level of detail settings determine the rendering fidelity of meshes. By default, meshes always display in the most precise fidelity, no matter how far they are from the camera, but you can dynamically control a mesh's level of detail using its Enum.RenderFidelity property.

If you have many detailed meshes, setting less necessary ones to a lower fidelity can improve your experience's performance. Or, you can set the property to Automatic for all meshes to render their levels of detail based on their distances from the camera:

Distance From Camera Render Fidelity Example
Less than 250 studs Highest
250-500 studs Medium
500 or more studs Lowest

Collision Fidelity

Collision fidelity determines how closely the visual representation of a mesh matches its physical bounds. The Class.MeshPart.CollisionFidelity property has the following options, in order of fidelity and performance impact from lowest to highest:

  • Box: Creates a bounding collision box, ideal for small or non-interactive objects.
  • Hull: Generates a convex hull, suitable for objects with less pronounced indentations or cavities.
  • Default: Produces an approximate collision shape that supports concavity, suitable for complex objects with semi-detailed interaction needs.
  • PreciseConvexDecomposition: Offers the most precise fidelity but still not a 1:1 representation of the visual. This option has the most expensive performance cost and takes longer for the engine to compute.

To visualize collision fidelity in Studio, open File > Studio Settings > Studio > Visualization, then enable Show Decomposition Geometry.

Original mesh of castle tower

Collision fidelity of Default shown for mesh

Collision fidelity of Box shown for mesh

Collision fidelity of Hull shown for mesh

Collision fidelity of PreciseConvexDecomposition shown for mesh

For more information on the performance impact of collision fidelity options and how to mitigate them, see Performance Optimization. For an in-depth walkthrough on how to choose a collision fidelity option that balances your precision and performance requirements, see Set Physics and Rendering Parameters.

Rigging and Skinning Meshes

Rigging is the process of connecting a mesh with an internal poseable skeleton rig. Rigged meshes allow mesh surfaces to rotate and move using internal bones within a model, such as a character's knee or elbow. Skinning a rigged mesh allows the rigged mesh object to deform, stretch, and bend in a more realistic manner.

Without skinning, the entire head mesh rotates on a single axis With skinning, the head mesh bends naturally at the neck, and the bottom of the neck stays connected to the torso

For more information on rigging and skinning, see Rigging and Skinning. After rigging a mesh, you can add animation and poses to it using the Animation Editor. See Creating an Animation for more information. Marketplace 3D assets, such as avatar clothing and bodies, also require rigging and skinning. See Avatar for more information on requirements for Marketplace assets.