Hello Guest

Author Topic: Changing shader for tilemap (lighting)  (Read 5094 times)

Afro-Ninja

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 62
    • View Profile
Changing shader for tilemap (lighting)
« on: July 25, 2013, 10:31:40 pm »
I searched and found this topic:

http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1080.msg5241.html#msg5241

and just wanted to know if there was any follow up to it, or any changes/fixes since this release.
should I still do what maas suggests and just comment that line so the normals are always recalculated?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Changing shader for tilemap (lighting)
« Reply #1 on: July 25, 2013, 11:09:40 pm »
You still need to call RecalculateNormals.

Pfaeff

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Changing shader for tilemap (lighting)
« Reply #2 on: August 20, 2013, 11:06:08 am »
I wanted to enable lighting for my tilemaps. What I did, was simply add
Code: [Select]
chunk.mesh.RecalculateNormals();below
Code: [Select]
chunk.mesh.RecalculateBounds();in the BuildForChunkRoutine and it seems to work just fine.