# UIMesh

> Bundle of vertex, index, and optional extras slices passed to MeshGenerationContext.DrawMesh.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.UIElements](/engine/6000.7/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public struct UIMesh
```

## Remarks

[\_vertices](/engine/6000.7/script-reference/unityengine/uielements/uimesh/vertices.md) and [\_indices](/engine/6000.7/script-reference/unityengine/uielements/uimesh/indices.md) are required. The optional extras ([\_uv1](/engine/6000.7/script-reference/unityengine/uielements/uimesh/uv1.md), [\_uv2](/engine/6000.7/script-reference/unityengine/uielements/uimesh/uv2.md), [\_uv3](/engine/6000.7/script-reference/unityengine/uielements/uimesh/uv3.md), [\_normal](/engine/6000.7/script-reference/unityengine/uielements/uimesh/normal.md), [\_tangent](/engine/6000.7/script-reference/unityengine/uielements/uimesh/tangent.md)) are channels the panel must have opted into via [\_extraVertexChannels](/engine/6000.7/script-reference/unityengine/uielements/panelsettings/extravertexchannels.md) or [\_extraVertexChannels](/engine/6000.7/script-reference/unityengine/uielements/ipanel/extravertexchannels.md). Providing a slice for a channel the panel did not enable logs an error and drops that slice.

Each non-empty extras slice must have `Length == vertices.Length`; mismatches are logged and the entire draw is dropped.

Channels enabled on the panel but left empty in the draw are zero-filled.

Slices passed to [MeshGenerationContext.DrawMesh](/engine/6000.7/script-reference/unityengine/uielements/meshgenerationcontext/drawmesh.md) are read at flush time, not at the call site. Slices returned by [MeshGenerationContext.AllocateTempMesh](/engine/6000.7/script-reference/unityengine/uielements/meshgenerationcontext/allocatetempmesh.md) are guaranteed valid through the flush; user-supplied slices must remain valid until the same flush point.

## Properties

| Property                                                                              | Description                                                        |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [indices](/engine/6000.7/script-reference/unityengine/uielements/uimesh/indices.md)   | Triangle list indices.                                             |
| [normal](/engine/6000.7/script-reference/unityengine/uielements/uimesh/normal.md)     | Vertex normals. Padded to `Vector4` on the GPU (`.w` zero-filled). |
| [tangent](/engine/6000.7/script-reference/unityengine/uielements/uimesh/tangent.md)   | Vertex tangents (`.w` = handedness).                               |
| [uv1](/engine/6000.7/script-reference/unityengine/uielements/uimesh/uv1.md)           | UV1 coordinates (TEXCOORD1 in the shader).                         |
| [uv2](/engine/6000.7/script-reference/unityengine/uielements/uimesh/uv2.md)           | UV2 coordinates (TEXCOORD2 in the shader).                         |
| [uv3](/engine/6000.7/script-reference/unityengine/uielements/uimesh/uv3.md)           | UV3 coordinates (TEXCOORD3 in the shader).                         |
| [vertices](/engine/6000.7/script-reference/unityengine/uielements/uimesh/vertices.md) | Vertex positions, colors, and UVs.                                 |
