Hello
Guest
Home
Help
Search
Login
Register
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Tilemap affected by light
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tilemap affected by light (Read 5337 times)
deathbypixel
2D Toolkit
Newbie
Posts: 2
Tilemap affected by light
«
on:
November 26, 2012, 10:04:50 pm »
Hello and thanks for a fantastic product!
I have created a tile map in a scene (I'm using a perspective camera) and I'm wondering what approach I should use to get my tiles affected by light, e.g. with a spotlight.
Cheers!
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: Tilemap affected by light
«
Reply #1 on:
November 26, 2012, 11:29:26 pm »
You will need normals for this to work...
in tk2dTileMap.cs, line 132, comment this out so it reads:
Code:
[Select]
//
if (tileMap.serializeRenderData)
chunk.mesh.RecalculateNormals();
Now you should be able to just switch to a lit shader and lights should work
Logged
deathbypixel
2D Toolkit
Newbie
Posts: 2
Re: Tilemap affected by light
«
Reply #2 on:
November 27, 2012, 08:20:33 pm »
Thanks, worked perfectly! Note that this was in k2dTileMapMeshBuilder.cs
How will this affect performance?
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: Tilemap affected by light
«
Reply #3 on:
November 27, 2012, 10:41:04 pm »
Shouldn't be any worse. It takes longer to actually build the tilemap, but if you're not modifying it at runtime, you shouldn't need to care.
Logged
Print
Pages: [
1
]
« previous
next »
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Tilemap affected by light