2D Toolkit Forum
2D Toolkit => Support => Topic started by: deathbypixel on November 26, 2012, 10:04:50 pm
-
Hello and thanks for a fantastic product!
I have created a tile map in a scene (I'm using a perspective camera) and I'm wondering what approach I should use to get my tiles affected by light, e.g. with a spotlight.
Cheers!
-
You will need normals for this to work...
in tk2dTileMap.cs, line 132, comment this out so it reads:
// if (tileMap.serializeRenderData)
chunk.mesh.RecalculateNormals();
Now you should be able to just switch to a lit shader and lights should work
-
Thanks, worked perfectly! Note that this was in k2dTileMapMeshBuilder.cs
How will this affect performance?
-
Shouldn't be any worse. It takes longer to actually build the tilemap, but if you're not modifying it at runtime, you shouldn't need to care.