Hello Guest

Author Topic: Normals support on Clipped Sprite?  (Read 4988 times)

jeresun

  • Newbie
  • *
  • Posts: 6
    • View Profile
Normals support on Clipped Sprite?
« 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Normals support on Clipped Sprite?
« Reply #1 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?

jeresun

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Normals support on Clipped Sprite?
« Reply #2 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Normals support on Clipped Sprite?
« Reply #3 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

jeresun

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Normals support on Clipped Sprite?
« Reply #4 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Normals support on Clipped Sprite?
« Reply #5 on: July 20, 2013, 10:29:23 pm »
Can you email a repro case to support at unikronsoftware.com, please?