2D Toolkit Forum

2D Toolkit => Support => Topic started by: jeresun on July 04, 2013, 10:34:42 pm

Title: Normals support on Clipped Sprite?
Post by: jeresun on July 04, 2013, 10:34:42 pm
Hi, I've changed the code based on a previous topic to comment out the line in tk2dTileMapMeshBuilder.cs:

if (tileMap.serializeRenderData)

This works fine for tilemaps and regular sprites, but when I try to add clipped sprites, the normals are still in the opposite direction. Any fix for this? Thanks.

Jeremiah
Title: Re: Normals support on Clipped Sprite?
Post by: unikronsoftware on July 05, 2013, 09:09:57 am
Is your clipped sprite flipped? mesh.RecalculateNormals should produce "forward" facing normals, unless the clipped sprite is flipped to start with. What version of tk2d are you using?
Title: Re: Normals support on Clipped Sprite?
Post by: jeresun on July 05, 2013, 07:59:59 pm
My sprites are not flipped. In addition to clipped sprites, this issue occurs also on tiled and sliced sprites. I am using version 2 final + hotfix 2. Thanks

Jeremiah
Title: Re: Normals support on Clipped Sprite?
Post by: unikronsoftware on July 05, 2013, 10:41:54 pm
I just tested this, and it seems to work fine. What happens if you switch to a default unity shader, is it facing the correct direction? Just in case it was generating flipped geometry for some reason
Title: Re: Normals support on Clipped Sprite?
Post by: jeresun on July 20, 2013, 08:34:00 pm
sorry for the late reply. I changed the material to a unity shader, and the mesh is facing the correct direction, but the lighting is still reversed. I created a new project and downloaded 2d toolkit from scratch, and I am still getting the same problem with only sliced and tiled sprites. Thanks
Title: Re: Normals support on Clipped Sprite?
Post by: unikronsoftware on July 20, 2013, 10:29:23 pm
Can you email a repro case to support at unikronsoftware.com, please?