Draw only visible tiles

I am working on tile based game (map dimensions more than 1500x1500 tiles), data stored in 2d array. I care about performance. Which approach is better - to draw only tiles visible on the screen or whole map at once? And how will this affect the Draw Calls.

That’s over 2 million tiles, which will have extremely bad performance if you use a separate object for every tile. You can either use a pooling system, or create meshes (each one containing many tiles) using the Mesh class.

–Eric

Impossible to create them all at once. Assuming you want each in a separate GameObject, because they have more functionality than just display, you’d want to create only those visible, and probably another screen in each direction.

Then when your camera scrolls, take the opposite side of the one your camera is moving to, and move them to create a new line in the movement direction instead. Re-set the display (assuming tiles don’t all look the same) so they look as they are supposed to.

Or, use any of the tile map assets from the asset store. Personally I use 2D Toolkit. I haven’t used any of the others, so I can’t give a comparison.

I’m sorry, that did not answer for so long. I’m in the hospital.
Eric5h5 Could you tell me more about meshes?
Tomer Barkan And if I have created only the number of objects that fit on the screen. In the case of movement of the character I’m going to change the sprite renderer images of these objects.
How will this affect the performance?