Hello Guest

Author Topic: 2D Tilemap, many layers and diffuse shader  (Read 3587 times)

DJVDJV

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
2D Tilemap, many layers and diffuse shader
« on: May 25, 2015, 06:16:56 am »
Hello,

I have map with many layers and tiles have diffuse shader.

I have layers like:

Layer0 = LiquidLayer (Like lava and water tiles)
Layer1 = GroundLayer (Like floor)
Layer2 = TerrainLayer (Like walls)
Layer3 = StuffLayer (Like furnitures etc)

Tiles have also diffuse shader for lights.

Problem 1:
I want Furiniture A lighted in layer3. Problem comes here: Stuff in Layer0, Layer1 and Layer2 affects color of Furniture A texture. And it comes very dark.
So how to make layer3 color ignore layer0,layer1 and layer2.. Just affected by cameras colour?

Problem 2:
I put colored plane under all layers and it affects color of all tiles in every layer. (Example black plane makes all tiles total black)
So how to make layers to ignore colored planes etc?

What I do wrong with shader? How to fix these? Any workarounds? Any tutorials?

Y,
DJV



unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Tilemap, many layers and diffuse shader
« Reply #1 on: May 25, 2015, 11:24:40 pm »
Problem 1 - You will need to read up about how Unity lights work with layers. You can light objects / meshes selectively using layers. Unity docs is probably the best place for this.

Problem 2 - This can be done with shaders and various other workarounds but the details are completely out of scope of 2D Toolkit support, the one thing to keep in mind is tk2d objects are just unity meshes - a solution that will work with Unity meshes will work here.