Search Unity

Lighting Artifacts on Overlapping Meshes

Discussion in 'General Graphics' started by HeyBishop, Aug 7, 2019.

  1. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    I have a problem that's proving to be a challenge to use the right search keywords to find a solution. So here goes...

    I have a scene with realtime lighting. Some of the meshes overlap. Where those meshes overlap and are lit by a point light or spot light, some strange artifacts appear. I've attached a screen capture of it, and circle the artifacts. You'll notice the problem presents itself in both the Game and Scene windows.

    You could describe the artifact as a zipper, as noise (it dances when the camera moves).

    Any ideas how to get rid of these artifacts?

    Additional information:
    Unity 2019.1.7f1
    Using realtime lights.
    Lightmapper Enlighten
    Quality Pixel Count 25
    Texture Quality FulRes
    Anti Aliasing 4x (doesn't seem to matter)
     

    Attached Files:

  2. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    350
    Deferred Shading can solve that problem, but also may cause some others.
     
    Last edited: Aug 7, 2019
  3. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    Yes, I did notice that deferred helped with this problem... yet it did cause other problems.
     
  4. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    201
    Are you sure there is no baked lighting or Realtime GI?

    Because i am a little confused, you say the lighting is realtime but you listed enlighten.

    As for the issue, nothing comes to mind in realtime lighting which would brighten up geometry on mesh intersections. The description about flickering reminds me of Z fighting, but i'm not sure what that has to do with the brightening of the intersection.

    Also, what is the clear flags on camera and if it is color or skybox, what color does it clear to? maybe this brightening happens because it renders the skybox/clear_color somehow on these intersections? and deferred rendering wouldn't help in this case either.

    More information would be helpful, if there are additional other odd things happening, please share, that could point us in the right direction.
     
  5. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    350
    It's really easy to reproduce.
    Point and spot lights use additional blending mode, that fact plus z-fighting produce twice more light inside intersecting zones.
     
  6. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    201
    Okay, now i get it. That is not just intersection, as in a line formed by intersection, that is more like overlaying, which is a plane formed on their... overlaying.

    The solution to that would be to not make meshes overlay on top of each other, just make them end where the other begins. Is this not an option?
     
  7. HeyBishop

    HeyBishop

    Joined:
    Jun 22, 2017
    Posts:
    238
    You've explained this very well. Thank you.

    This suggestion is sort of an option, but an undesired option. I'm not a modeler, so I'm mashing purchased assets together to make them fit how I want. I've found ways to offset one mesh just a hair, while leaving colliders so that they are the exact same location - necessary for my player character.

    Thank you all for your feedback.

    If anyone has any magic bullet suggestions that will remove this problem without me having to offset meshes, I'd be very appreciative!