- Home /
Exceeding '64k' vertex limit on objects
Alright, so I'm creating terrain according to a C# script because I found that it offers me more control and blends with what else I have in mind better.
An issue I'm running into is that once the terrain requires what seems to be about 65536 or more vertices, it starts telling me that I'm attempting to reference invalid vertices when I put everything together.
So, my main question is is there any way to exceed the 64k vertex limit?
If not, I guess I'll just work my way around breaking the problem into sets of smaller objects.
If so, how do I change the limit?
Answer by Eric5h5 · Aug 11, 2013 at 06:16 AM
You cannot, 2^16 = 65,536. More than that requires separate meshes.
Alrighty, guess I'll start changing things around.
Thanks.
EDIT: I will wait a bit before marking this as correct in case there is some weird non-script/multi-mesh workaround.
There is no workaround. Not with Unity's rendering engine
Actually it's exactly 65k. I had to split up a ~1mil vertices .obj into pieces and tried $$anonymous$$athf.Pow(2,16), but that's still to much. 65,000 works. :)
Actually it's not exactly 65$$anonymous$$. It's 65,534. Technically it should be 65,536 but for some reason that doesn't work; I guess 2 bytes are used for something.
Uh, interesting. :) Do you know, why there is this limit in the first place? In other applications you might have meshes of unlimited size, so why is it limited here? If for performance reasons, I think it should be possible to be set by the dev. :S