You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not an issue but an improvement:
On Unity 2017 or higher, you can have more than 65000 vertices per mesh changing the Mesh.indexFormat to 32bits.
I modified MeshBaker.cs to support up to 2 billion vertices in a single mesh:
change line 17: private const int MAX_VERTEX_COUNT_PER_ONE_OBJECT = int.MaxValue-1;// 65000;
change line 277: newMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
that's it.
Note: in theory, Unity should support up to 4 billion vertices, not "just" 2 billion, using UINT instead of INT as max value, but since the C# vertex list index property seems to be only in INT format, I settled for 2 billion vertices to avoid any possible issues.
The text was updated successfully, but these errors were encountered:
Note that not all devices accept 32bit index formats, (some Mali GPUs on Android don't) so this should ideally be an option.
Also, using 32bit index when not needed increases bandwidth unnecessarily, so if vertex number is lower than 65k, using the default 16bit index format will be faster, specially on mobile.
So line 277 should be better like this: if (vertexes.Count>65000) newMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
Not an issue but an improvement:
On Unity 2017 or higher, you can have more than 65000 vertices per mesh changing the Mesh.indexFormat to 32bits.
I modified MeshBaker.cs to support up to 2 billion vertices in a single mesh:
change line 17:
private const int MAX_VERTEX_COUNT_PER_ONE_OBJECT = int.MaxValue-1;// 65000;
change line 277:
newMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
that's it.
Note: in theory, Unity should support up to 4 billion vertices, not "just" 2 billion, using UINT instead of INT as max value, but since the C# vertex list index property seems to be only in INT format, I settled for 2 billion vertices to avoid any possible issues.
The text was updated successfully, but these errors were encountered: