2D Toolkit Forum

2D Toolkit => Support => Topic started by: grofit on February 10, 2015, 10:45:10 am

Title: Using lit shaders with tilemaps
Post by: grofit on February 10, 2015, 10:45:10 am
Hey,

Sorry if this is a simple question but I could not find a specific answer anywhere...

So I have a tilemap which is generated from a sprite sheet, and I want to use the lighting shaders on it, however it be default uses the atlas0 material, which I assume is auto generated, so I noticed there is support for multiple materials, but I just wanted to know what the correct workflow would be.

Is it just a case of me adding another material to the sprite collection of the sprite collection for the tiles? also do I need just the normals generated or should I be generating the normals and tangents etc?
Title: Re: Using lit shaders with tilemaps
Post by: unikronsoftware on February 10, 2015, 11:32:11 am
make sure generate normals ticked in the sprite collection.
Change the atlas material to be a lit shader, that should be it.
Title: Re: Using lit shaders with tilemaps
Post by: grofit on February 10, 2015, 01:13:00 pm
This will effect everything within the atlas though right?

In this instance it seems safe enough to do, but is there a way to only specify a single sprite collection to use it and others to not?


Upon searching I now realise that these are auto generated per sprite collection, so although all sprite collections use atlas0, it is not the SAME atlas0 material, is there a way to specify the names to use for atlases?
Title: Re: Using lit shaders with tilemaps
Post by: unikronsoftware on February 10, 2015, 02:06:47 pm
No, but you can rename the atlases after they are created.

* be sure to do it in unity...