Search Unity

PLM GPU Does not "bleed" correctly between meshes

Discussion in 'Global Illumination' started by Max-om, Dec 16, 2021.

  1. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    Observe the seam at the middle of the screen

    upload_2021-12-16_15-7-52.png

    upload_2021-12-16_15-9-47.png

    upload_2021-12-16_15-10-25.png

    upload_2021-12-16_15-12-3.png

    Normally Unity bleeds too much between seams. But in this case it bleeds too little :D

    So whats up? Unity 2020.3.24
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    The UVs of those meshes don't have enough padding for Unity to be able to stitch the seams properly.

    The UV Overlap view is key here, you should have much less red areas visible, ideally none.
     
  3. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    Hi, yeah I know.
    The problem area has zero overlap though. And the problem is the opposite of bleed.

    upload_2021-12-17_9-37-43.png

    These are bleed problems and they are caused by overlap seen in the overlap view.

    upload_2021-12-17_9-42-3.png
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    Why is it the opposite of bleed? Bleed doesn't necessarily mean it's bright colors that do it, dark colors can bleed too.

    You need more padding for the UVs, that's what the overlap debug view is telling you.

    Or to make better UVs. In cases like these, you would typically make only one seam, and you would hide it in the area that is facing the wall, so it's never visible, so even if there is some discontinuity in the lighting, it will not be visible.
     
  5. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    Check my overlap view. The problem area has ZERO bleed

    Are you saying I need to fix manual UVs for all my walls?

    There must be a more automated aprouch for modular assets like these, modular assets are standard in Unity asset store. Here is another example. Not as visible though.

    upload_2021-12-17_10-40-8.png
     
    Last edited: Dec 17, 2021
  6. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    Take a area like this. I would need to stitch the entire corridor together. Not good for reflection probes or occlusion culling


    upload_2021-12-17_10-44-48.png
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    Aren't the seams exactly where the red parts are in the overlap view?
     
  8. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    Don't the red parts clearly indicate the problem areas?
    problem_areas.jpg
     
  9. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499

    I'm out on lunch let me outline them better in an hour
     
  10. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    Back

    upload_2021-12-17_13-10-44.png

    upload_2021-12-17_13-11-25.png
     
  11. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    If the seam is not caused by UV overlap, it could be because of the way it was unwrapped. Can you please select the two sections of the wall and share the lightmap view of them with the UV mesh drawn on top (find this in the MeshRenderer inspector)
     
  12. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499

    Its just two planes, (well the door frame is a bit more complex than a simple plane but you get the idea.

    upload_2021-12-17_13-53-11.png


    upload_2021-12-17_13-53-47.png
     
  13. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    Here is a another example of two normal simple planes

    upload_2021-12-17_14-4-10.png
     
  14. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    Hey, so let's clear things out because I'm slightly confused.

    The seam we are talking about is the seam on the wall, and not on the cylinder then?

    In that case, there isn't too much you can do, other than merging the two parts of the wall so they are the same mesh. Then you can either rely on Unity's seam stitching, or even better just merge the UVs so there's no seam. But they need to be the same mesh.

    If that is impossible, the best you can do is use as little filtering as possible, none ideally (any sort of blurring of the lightmap or discontinuous filtering will exacerbate the issue) and learn to live with a bit of lightmap discontinuities here and there.

    In general, lightmapping is a thing you have to keep in mind when modelling a little bit, so you can control where and if seams will be visible so you can put them in areas that are unimportant, or hidden.
     
  15. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    I get it when authoring props and dressing assets. But the level itself (walls, floor, ceiling, etc). Without tooling support it's a nightmare, i need to export meshes with fbx export. Manually config UV and import and replace orginal meshes.

    Stiching is enabled.
     
  16. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    Export? Are you making your levels with pro builder or something?

    I don't know what to tell you. I always did all my geo in modo so I had complete control of UVs for lightmapping. As long as those are different meshes, eliminating the seam completely is impossible. Stitching works within the same mesh, not between different meshes.
     
  17. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    Nah it's a modular asset, wall segments, floor segments etc. It's how most modular assets work on the store. Each segment snap to the grid so it's easy to make your level directly in unity editor.
     
  18. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    In blender there is a feature to weld vertices together. You can set a threshold how close they need to be to be considered the same. Unity lightmapper should do the same in it's lightmap packing stage. It would also need to look at the plane and it's angle, default very conservative, flat plane to be packed together.
     
    Last edited: Dec 18, 2021
  19. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    I can imagine many use cases where this is undesirable. And if we ever get a feature like this, we're definitely at least a couple of years away from it.

    In the meantime, if you need that seam gone, those meshes need to become one. There is no other way right now.

    As I said previously, you can maybe minimize how visible it is by using less filtering all around.

    Or you could tweak the lighting? (it's unfortunate that the seam falls right on the edge of the shadow, it would be far less noticeable if it was fully in the shadow or completely in the light)
     
  20. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    Yeah it need conservative settings as default. But it would be really nice for us that use modular assets.
     
  21. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    Yeah, I never found the modular workflow to work really well with Unity.

    I would use it only if I was making procedural levels (in which case, I would probably not be lightmapping), or only as a prototyping tool with the intent to replace the modules with custom geometry at some point.
     
  22. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499

    I've been waiting for years on spatial grouping of meshes so they end up on the same lightmap, now i need Todo it manualy with custom lightmap settings with different lightmap tags. (Better drawcall bathing if near by meshes on same lightmap). So I can wait a few years on this too :)
     
  23. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    I just asked chat GPT to join all meshes that shares vertices if they also shares the same plane. And the result kind of worked. If chat GPT can do it surly unity can fix this in their lightmap packer stage :)