Hello Guest

Author Topic: Using lit shaders with tilemaps  (Read 4591 times)

grofit

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Using lit shaders with tilemaps
« 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?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Using lit shaders with tilemaps
« Reply #1 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.

grofit

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Using lit shaders with tilemaps
« Reply #2 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?
« Last Edit: February 10, 2015, 01:22:28 pm by grofit »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Using lit shaders with tilemaps
« Reply #3 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...