0

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?

Enrique Moreno Tent
  • 1,998
  • 4
  • 22
  • 32

1 Answers1

1

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

Enrique Moreno Tent
  • 1,998
  • 4
  • 22
  • 32