mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-26 21:04:14 -05:00
Merge pull request #1374 from ousttrue/fix10/fix_indexFormat
[1.0] indices が 65535 を超える場合に indexFormat をセットする
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user