Seanba / Tiled2Unity

Export Tiled Map Editor (TMX) files into Unity
Other
499 stars 121 forks source link

Diffuse shader + spot light + extruded tiles = light only affects intersections #160

Open valba8 opened 6 years ago

valba8 commented 6 years ago

Hi,

I was trying to illuminate a tiled map imported with Tiled2Unity, so I imported the map as usual and then I changed the shader to Tiled2Unity/Diffuse Depth (Instanced). An important point is that my tiles were extruded some pixels to avoid or minimize the seams problem. So finally I added a point light to the scene and then I got this result:

tiles_light

As you can see, it seems like only the extruded parts are illuminated, while the main part of each tile remains dark. I tried several other shaders (like DefaultDiffuse and others) and the effect is always the same. With a directional light the effect disappears (but if you have another spot/point light in the scene the effect keeps appearing in the near tiles).