mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-25 07:28:51 -05:00
set indexFormat
This commit is contained in:
parent
0e997d4162
commit
77cc07f3d9
|
|
@ -16,6 +16,10 @@ namespace UniVRM10
|
|||
{
|
||||
// submesh 方式
|
||||
var mesh = new UnityEngine.Mesh();
|
||||
if (src.IndexBuffer.Count > UInt16.MaxValue)
|
||||
{
|
||||
mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
|
||||
}
|
||||
|
||||
mesh.vertices = src.VertexBuffer.Positions.GetSpan<Vector3>().ToArray();
|
||||
mesh.normals = src.VertexBuffer.Normals?.GetSpan<Vector3>().ToArray();
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ namespace UniVRM10
|
|||
public static UnityEngine.Mesh LoadDivided(VrmLib.MeshGroup src)
|
||||
{
|
||||
var dst = new UnityEngine.Mesh();
|
||||
if (src.Meshes.Sum(x => x.IndexBuffer.Count) > ushort.MaxValue)
|
||||
{
|
||||
dst.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
|
||||
}
|
||||
|
||||
//
|
||||
// vertices
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user