Hello Guest

Author Topic: Lit Shaders working in Mac but not Windows  (Read 5785 times)

jeresun

  • Newbie
  • *
  • Posts: 6
    • View Profile
Lit Shaders working in Mac but not Windows
« on: August 07, 2012, 07:04:37 am »
Hi, I have two issues. I built a scene using all sprites, and I used the LitBlendVertexColor shader so that I could light the scene. The environment is supposed to be a dark maze where the character holds a flashlight to navigate. Anyway, the scene works completely fine in the Mac version of Unity3D, but when I either build out the windows build, or open the project in the windows version of unity, the sprites are not lit at all. This is strange as in the web player build, when I load it on a mac web browser it shows up, and from windows it doesn't.

My second issue is that with the included shaders, the sprites need to be lit from the back side of the sprite in order for it to show up instead of from the front. Is this normal? Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Lit Shaders working in Mac but not Windows
« Reply #1 on: August 07, 2012, 08:01:07 am »
This should definitely work fine in Windows.
Do you have normals and tangents enabled or just normals?

jeresun

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Lit Shaders working in Mac but not Windows
« Reply #2 on: August 07, 2012, 09:14:07 am »
Yes, I've tried turning them on and off, but the result is the same. I forgot to mention that this problem only occurs on tilemaps. Regular sprites have no problem.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Lit Shaders working in Mac but not Windows
« Reply #3 on: August 07, 2012, 07:17:56 pm »
Looks like the normals aren't set in the tilemap. I'll get this sorted in the next release. For the time being though, all you need to do is replace these lines in tk2dTileMapMeshBuilder.cs

Code: [Select]
if (tileMap.serializeRenderData)
chunk.mesh.RecalculateNormals();

with

Code: [Select]
chunk.mesh.RecalculateNormals();

The next time the tilemap is built, it should work fine.

jeresun

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Lit Shaders working in Mac but not Windows
« Reply #4 on: August 07, 2012, 10:16:41 pm »
Works perfectly now. Thanks!