2D Toolkit Forum

2D Toolkit => Support => Topic started by: Demonocrat on September 21, 2013, 10:27:06 am

Title: No light on Tiled Sprite
Post by: Demonocrat 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?
Title: Re: No light on Tiled Sprite
Post by: unikronsoftware 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 );
Title: Re: No light on Tiled Sprite
Post by: Demonocrat on September 21, 2013, 01:02:11 pm
It worked!
Thanks alot!