Jump to content

Collapsing Tilemap Layers with Masking, Best Practice?


Recommended Posts

I have a Tilemap with 4 layers.  I need to render the layers like this:


- draw layer 1

- use layer 2 as a mask for layer 3

- draw the masked layer 3

- draw game sprites

- draw layer 4


I do not want the overhead of pushing 4 layers for every frame.  Is there an easy way to collapse and pre-render layers 1, 2, 3 so that at run time only two layers need to be drawn?


My current thinking is to write a tool that bakes layers 1, 2, 3 together into a new, procedurally generated tileset and tilemap pair for the game.  Of course, I would prefer an easier approach if one exists.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...