Any chance this could be elaborated on?
To calculate the normals in the tk2dSpriteCollectionBuilder.cs
it contains these lines after the normals are recalculated to calculate the tangents.
tmpMesh.RecalculateNormals();
coll.spriteDefinitions.normals = tmpMesh.normals;
if (gen.normalGenerationMode == tk2dSpriteCollection.NormalGenerationMode.NormalsAndTangents)
{
Vector4[] tangents = new Vector4[tmpMesh.normals.Length];
for (int t = 0; t < tangents.Length; ++t)
tangents[t] = new Vector4(1, 0, 0, -1);
coll.spriteDefinitions.tangents = tangents;
}
I have found "chunk.mesh.RecalculateNormals();" inside the tile tk2dTileMapMeshBuilder.cs
but I am unsure of how to apply the simple tangent code above to the TileMap.
Any help would be greatly appreciated
Edit : I have solved the problem by using the attached script called "TangentSolver.cs"
and implementing this line of code "TangentSolver.Solve(chunk.mesh);"
inside the tile tk2dTileMapMeshBuilder.cs script just after the normals are recalculated.
Like so
chunk.mesh.RecalculateNormals();
TangentSolver.Solve(chunk.mesh);
Works like a charm,
Maybe you could implement this code into the next update.