Search Unity

ProBuilder - Getting Weird Lightmap Lines

Discussion in 'World Building' started by KITPUNK, Jan 30, 2019.

  1. KITPUNK

    KITPUNK

    Joined:
    Nov 11, 2014
    Posts:
    13
    I have a column I've made in ProBuilder 3.09, it's UV unwrapped with no overlaps and if I bake it on its own (in an empty scene), the lightmaps work perfectly. Once I introduce it into my main scene, I get these weird lines that appear:



    The lines are not even on the edge seams of the UV either and they appear randomly on each column in the scene. I've replicated the lighting conditions in my test scene (where the bake worked) and no luck. I've tried increasing the direct and indirect resolutions, lightmap padding, etc. and played with the directional light bias.

    It's only on these objects and can't quite figure it out. Any suggestions would be lovely.

    Thanks!
     
    Last edited: Jan 31, 2019
  2. KITPUNK

    KITPUNK

    Joined:
    Nov 11, 2014
    Posts:
    13
    Just to follow up on this. After further investigation, the lines *DO* appear in an empty scene, contrary to what I first explained. The light being intense on the white texture, made the lines hard to see at first glance, but they do in fact exist after re-examining.

    It seems this issue might be beyond ProBuilder and a lightmap issue in general. The lines only appear on cylindrical objects with many faces (talking more than 16, where it appears "smooth"). I've re-edited the column several times, even rebuilt it in Blender from the ground up and the lines persist. I've tried both with smoothing and without to see if it's a rendering issue with split edges.

    As a basic test, I've even use primitive cylinders from Blender and ProBuider (which I've updated to 4.03), both manually unwrapped and default. The lines appear still when baked. I figured it was an issue with UV2 breaking up the ProBuilder mesh, but after adjusting the settings to make sure it didn't break up the cylinder faces into several groups, it made no difference. The lines are not even on the seams of face islands.

    I ended up giving up as it's costing me too much time and went with more square columns which they work perfectly with lightmaps.

    Would still like to know what the issue is or what I am doing wrong for future reference. Just figured I'd post my findings.
     
  3. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Hey! Hmm, yep sounds like it's more than PB...but maybe I can help anyway. Have you tried clearing the GI cache? "Edit > Prefs > GI Cache > Clean Cache". That can clear out old data that might be causing trouble.
     
  4. KITPUNK

    KITPUNK

    Joined:
    Nov 11, 2014
    Posts:
    13
    I gave that a shot and sadly no change. The issue still remains.

    I made another test scene. This is with GI cache cleared, first lightmap bake of this scene, single directional light at default settings, lightmap resolution at 10 texels:



    and again at the default 40 texels:



    I've tried very long bakes at 60 in previous test scenes with similar results still. It's seemingly based on indirect lighting? I've also increased the resolution on with no changes.

    The objects are all UV mapped and made sure to reconstruct UV2's in ProBuilder. The cylinder UV fits inside the UV map (hence why the texture is larger than the tiled square wall and floor), but even tiled on the cylinder, it remains. the lines that appear are not on the edges of the face island, they are near the middle of them.
     
  5. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Bummer, that's helped me before.

    What version of Unity is this?
     
  6. KITPUNK

    KITPUNK

    Joined:
    Nov 11, 2014
    Posts:
    13
    2018.3.3f1 and also tried on 2018.3.2
     
  7. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Ah ok- can you upgrade to ProBuilder 4.x, then here's a list of all the general stuff I can think of that might help:

    - Open the "Generate UV2" settings (alt-click the button icon, or click the plus button next to the text if using that)
    - Make sure "Auto Lightmap UVs" is enabled
    - Click "Tools > ProBuilder > Repair > Rebuild all ProBuilder Objects"
    - Ensure your objects are Static
    - Ensure your light is Static, and set to Baked (or Mixed)
    - Open the lighting settings, and reset to default, just to ensure there isn't some strange setting conflict

    Hope that helps!
     
  8. KITPUNK

    KITPUNK

    Joined:
    Nov 11, 2014
    Posts:
    13
    So after more experimentation using the information you kindly provided:

    Made a new project (Unity 2018.3.3f1), recreated the test scene using ProBuilder (4.0.3). Auto Lightmap UV's enabled, single directional light set to baked, repaired all objects, default light settings (but hit reset just to be sure), cleared GI cache.

    Results? Well, after testing two methods; one without editing the UV and one with editing. If I leave the UV as default (meaning all the islands overlap from the auto-generated layout) it seems to work! I cannot find any lighting issues with the model. Once I go in and start to edit the UV, organize islands neatly, use stitching, etc. That is when all the issues appear again.

    So, some progress, haha. This narrows it down to being a UV issue it seems.
     
  9. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Interesting. The UV editor should (in theory) only affect UV1, not UV2 (lightmap uvs). I'm guessing some secondary action is happening/attribute is changing, will look into it also- thanks for the update, let me know if you discover anything new! :) -gw
     
  10. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    Hi! im not sure if related, im getting similar problem, but along all the edges of a geometry made with probuilder.
    This is s single mesh, but a get those dark lines after baking light maps.
    upload_2019-5-9_17-26-3.png
     
  11. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Hi Loards! What version of PB and Unity is this? Also, can you send me the scene to test? (the PB geo is stored in the scene, so that's all I need). Thanks!
     
  12. MishDotCom

    MishDotCom

    Joined:
    Jan 17, 2021
    Posts:
    34
    i love you man. i almost killed myself over this issue. this solved it wonderfully!