Hello Guest

Author Topic: No light on Tiled Sprite  (Read 4683 times)

Demonocrat

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
No light on Tiled Sprite
« on: September 21, 2013, 10:27:06 am »
Hello!
I have issue with litting my tiled sprite in the scene.
I have "letblindVertexColor" set and "normals only" enabled on atlas with my background sprites.

When i create single sprite from this atlas it lits fine from light sources, but when i try to create tiled sprite from the same atlas it stays dark and ignores all light sources in the scene.

What might be the issue?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: No light on Tiled Sprite
« Reply #1 on: September 21, 2013, 11:22:04 am »
Tiled sprites don't create vertex normals required for lighting. Add the line in bold to tk2dTiledSprite.cs and lighting will then work.

      mesh.RecalculateBounds();
      mesh.RecalculateNormals();
       mesh.bounds = AdjustedMeshBounds( mesh.bounds, renderLayer );

Demonocrat

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: No light on Tiled Sprite
« Reply #2 on: September 21, 2013, 01:02:11 pm »
It worked!
Thanks alot!