0
\$\begingroup\$

I have the following spritesheet for types of terrain, with a transparent background.

enter image description here

To draw it on my map, I thought of doing one mesh per type, and then combine them. This is the code.

This gave me at first quite good results.

enter image description here

But then I started trying maps of bigger dimensions, and after a certain point (I think it was 49x49), I got suddenly different results.

enter image description here

As you can see, at this point only seems to render 2 kinds of terrain, and the others have disappeared completely. Size is the only factor that was changed. Materials, Sprites, settings... everything else is completely the same.

Why could this be happening?

\$\endgroup\$
1
\$\begingroup\$

The problem is that there is a limit of vertices for a mesh when using 16bit. The limit is 65535 vertices.

The only solution here is rendering as smaller meshes, or turning on the 32bit meshes, which gives you a limit of 4 billion, at the cost of more memory.

More info here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.