1
\$\begingroup\$

I need to be able to efficiently render a tilemap which can be constructed this way:

There is one non-transparent base layer

Then there can be 3 partially-transparent layers on top of it. Each tile consist of tile texture + alpha texture.

I do not know much about rendering tile maps but I do have some knowledge of using shaders in Unity. I know something about control texture technique and about texture atlases.

I have about just 50 textures so I could easily put them all in one texture atlas 2048x2048 which most devices (even mobile) support today.

Also I have one animated texture (sea), so chosen approach should consider that.

What I don't know is how I should generate my mesh (two triangels per tile?) and which data exactly I should pass to my shader and how to do rendering there. Everything considering that there is 4 textures + 3 alpha textures per tile and they should be strictly ordered when rendered.

\$\endgroup\$
  • 3
    \$\begingroup\$ You make your tileset into an atlas and then you render portions of the tiles from the atlas. Don't just make every layer a texture - you'll regret it fast. \$\endgroup\$ – Vaughan Hilts Apr 26 '15 at 17:16

Your Answer

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

Browse other questions tagged or ask your own question.