Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

(Solved) Lightmapped Tiles Seam Blending Issues

Discussion in 'General Graphics' started by alexisrabadan, Jul 8, 2019.

  1. alexisrabadan

    alexisrabadan

    Joined:
    Aug 26, 2014
    Posts:
    81
    I have developed a system for lightmapped prefabs, they sit on individual tiles and can be rotated. When lightmapping, there are slight color deviations between the tiles. Is there any solution for this? Something like running a blending filter over the tiles maybe?

    BlendIssues.PNG Tiles.PNG
     
  2. alexisrabadan

    alexisrabadan

    Joined:
    Aug 26, 2014
    Posts:
    81
    Solved using a shader blending trick. Might not be the best solution, but it's the only thing I can think of that works. You will lose shadows/lighting data as well, but still looks fine in our game.

    Code (CSharp):
    1. fixed lightmapPower = clamp(i.uv0.z * _Blend * i.uv0.w * _Blend * (1 - i.uv0.z) * _Blend * (1 - i.uv0.w) * _Blend, 0, 1);
    Essentially just blends at the edges of each tile. Where blend was set to about 2.5