Search Unity

Mixing 2d sprites together in a large 2d sprite.

Discussion in '2D' started by chemariz, Feb 5, 2019.

  1. chemariz

    chemariz

    Joined:
    Feb 19, 2018
    Posts:
    5
    I am working in a 2d game with tiles. And I would like to improve the performance of the game by joining all the the tiles in each room in one big sprite. So instead of working with 100 tile sprites (room 10x10) Unity will only have to deal with a large sprite for each room.

    I used to do this in XNA engine, but Im not sure how is this done in Unity :( Can someone give me a hint of where should I start looking for?

    Thanks in advance!
     
  2. RichardKain

    RichardKain

    Joined:
    Oct 1, 2012
    Posts:
    1,261
    Well, it could be possible to do this with a render texture. You could render the tilemap to a render texture using an orthographic camera, and then apply that render texture to a simple quad. If your game's rooms are all the same size, the quad and render texture could be recycled for multiple rooms. Just an idea.