2D Toolkit Forum

2D Toolkit => Support => Topic started by: Elzean on October 30, 2012, 05:25:22 pm

Title: normal and tangent on Tilemap
Post by: Elzean on October 30, 2012, 05:25:22 pm
Hi!

i'm trying to use some 3d lights with sprites. It is working well with the usual sprite but i didnt succeed to make it work with the tilemap. I'm trying to arrange some code, but before making a mess i would like to know if its possible and if there is a simple solution to make this happen ?

Thanks!

Title: Re: normal and tangent on Tilemap
Post by: unikronsoftware on October 30, 2012, 07:25:02 pm
Hi,

If your tilemap is static, all you need to do is add this one line in tk2dTileMapMeshBuilder -

Code: [Select]
chunk.mesh.RecalculateNormals(); // add this line
chunk.mesh.RecalculateBounds();