Search Unity

Tiles and progressive lightmaps issue

Discussion in 'General Graphics' started by RockSPb, May 9, 2018.

  1. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    Hello! We use texture atlas and cut geometry per tile so we have a lot of UV cuts on flat surfaces.
    There is no UV cuts in lightmap channel, but progressive ligtmapper produce ugly seams via filtring (i think).
    Can I modify meta pass inside the shader so that it send to lightmapper UV3 channel instead of UV0. Or lightmappper gets UV directly from geometry?
    Or maybe I can swap uv channels (UV0 and UV3) on geometry during baking by the script?
    upload_2018-5-9_13-58-11.png upload_2018-5-9_14-13-0.png
     
  2. Yuvii

    Yuvii

    Joined:
    May 20, 2014
    Posts:
    55
    Hey,
    I didn't get it all, so just a few questions:

    -Is your wall made of tiling planes ? Or is it only one mesh, but divided only in the UV mapping?
    -What kind of light do you use here ? Area or emissiv planes ?
    -Do you have the same issue in Unity 2017.X ?
    -Do you have the same issue by using Enlighten ?
    -Did you check "Generate Lightmap UV" ? (if this is from imported FBX)

    Quickly tested with Unity 2017.3.1 and couldn't managed to get the same issue.

    both "planes" are made with 25 little independant planes. Left is a test with area lights, and right is a test with an emissive plane. i have the same render with progressive lightmapper & enlighten
     
    Last edited: May 9, 2018
  3. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    Hi! Thank you for responding.
    I can see some seams on your images. I think you need to set lightmap resolution smaller and create one plane from tiles with no cuts in ligtmaps UV channel. only in UV0 channel.

    -Is your wall made of tiling planes ? Or is it only one mesh, but divided only in the UV mapping?
    This is one mesh divaded in the UV, so no seams in lightmaps UV.

    -What kind of light do you use here ? Area or emissiv planes ?
    This is emissive plane. But this problem exists for all types of light sources.

    -Do you have the same issue in Unity 2017.X ?
    This problem exists on all version of 2017.x Unity.

    -Do you have the same issue by using Enlighten ?
    We don't use Enlighten because it have lots of other problems in quality and it's too slow.
    As I remember Enlighten don't have this kind of problem.

    -Did you check "Generate Lightmap UV" ? (if this is from imported FBX)
    Yes, but there is no difference.
     
  4. Yuvii

    Yuvii

    Joined:
    May 20, 2014
    Posts:
    55
    Hey,

    Yes, we see some seams in my image, on the emissive part (right) but they're not as clear as yours.

    As far as i know, emissive planes do kind of a plain lighting when it comes to details, no matter how you use them, they won't light a scene like an other kind of light would do (but they take a lot less time to bake).

    I only use emissive plane to make an ambient lighting, you know, mostly to make a global lighting (especially in interior scenes) then i add area lights, directionnal, etc to add more details.

    Weird thing is that if your wall is a single plane, checking Generate Lightmap UV should solve this kind of issue because it would make an UV only for the lighting pass.

    Sorry i can't help you, but anyway, if you manage to get rid of these seams with emissive planes, i'd like to know how you did it :D
     
  5. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    But it's not! I don't know why, but PLM use UV0 channel for sampling lightmaps, as you can see. It's not about light types or Lightmap UV, it's about how PLM works.
     
  6. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    Trying to swap UVs by script using sharedMesh, but no any changes.
    This mean PLM get geometry directly from fbx file?
     
  7. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    Why no one from unity can explain how exacly PLM loads geometry and textures into work?
    There is no documents about this. Is PLM use meta pass?
    I asked before about custom alpha for bake correct shadows but no one answered.
     
  8. AkiraWong89

    AkiraWong89

    Joined:
    Oct 30, 2015
    Posts:
    662
    Try to enable final gather and set the value to something 128 / 256, rebake and see.
     
  9. Ville

    Ville

    Joined:
    Oct 5, 2012
    Posts:
    19
    I was able to solve a very similar problem by making a script that automatically combining the tiles into one mesh when the lightmapper is started. After the lights are baked, it then copies the used lightmap index and coordinates to the original tiles. I use it for my large terrain that is tiled. Apparently both the progressive lightmapper and Enlighten both have problems with tile edges, the shadows just don't continue naturally across mesh edges.
     
  10. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    We solve this problem by using Bakery. Clean and nice result. Much better quality GI.