Version: 2023.1

Mesh.indexFormat

切换到手册
public Rendering.IndexFormat indexFormat ;

描述

网格索引缓冲区数据的格式。

Index buffer can either be 16 bit (supports up to 65536 vertices in a mesh), or 32 bit (supports up to 4 billion vertices). Default index format is 16 bit, since that takes less memory and bandwidth.

请注意,不是所有平台上都能保证 GPU 支持 32 位索引;例如, 采用 Mali-400 GPU 的 Android 设备就不支持这些索引。在此类平台上使用 32 位索引时,会记录警告消息, 不会渲染网格。

Note: the maximum possible vertex index (for example, 0xFFFF for a 16 bit index format) might not be usable. Some graphics APIs and GPUs skip rendering triangles with maximum vertex indices.

更改 indexFormat 会将 subMeshCount 设置为 1 并清除索引缓冲区。

Refer to Mesh.MeshData.GetIndexData for an example.

See Also: IndexFormat, ModelImporter.indexFormat, SetIndices, SetTriangles, SetIndexBufferParams, SetIndexBufferData, MeshData.