Search Unity

Light/dark pixels along the edge of objects

Discussion in 'General Graphics' started by ekergraphics, Apr 10, 2017.

  1. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257


    Has anyone encountered this? The screenshot is from the editor because this is a VR project which use some image effects (which actually unfortunately magnifies this problem).

    We're using a forward renderer with 4x msaa, no realtime GI and no baked GI, just directional light shadows.

    The objects with the bad pixels in the screenshot is literally a cube for a table leg and a plane for the floor. Toggling off the teleportarea doesn't remove the bad pixels.
     
  2. PeteUnity3D

    PeteUnity3D

    Unity Technologies

    Joined:
    Jan 4, 2016
    Posts:
    68
    Does the issue persist if MSAA is disabled? This looks like a bug with how MSAA is handling transparent objects in your project setup.

    Could you submit a bug please with Bug reporter in unity and let me know the issue number, please?
     
  3. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Well, the Unity bug reporter was helpful in locating the issue, which now seems to be many years old:

    https://forum.unity3d.com/threads/a...hite-outlines-on-objects.307137/#post-2278331

    And there's still semi-ongoing threads about this I just discovered:

    https://forum.unity3d.com/threads/j...-edges-with-specular-and-antialiasing.320984/

    But apparently the resolution is postponed due to possibly major rewriting requirements?

    https://issuetracker.unity3d.com/is...px-white-border-between-object-and-its-shadow
     
  4. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,692
    @Daerst is this maybe related to the issue I reported for your decal system? Not sure if this is helpfull but I thought it's worth a shot tagging you here.
     
  5. fjhamming_CleVR

    fjhamming_CleVR

    Joined:
    Feb 6, 2014
    Posts:
    8
    The viewport might try to give a preview of the image effects which could cause the problem. Also single pass stereo rendering might affect the edges in combination with msaa. Also ambient occlusion solutions have caused similar issues in my projects. (although the latest single stack ssao or latest hbao work fine as long as I don't touch single pass stereo)
     
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    24,664
    That's the problem though. It looks like the issue. The engine is quite a bit different these days so it's probably worth reporting. A lot of people do that, they see a similar issue and assume it's the same.

    Unity asked if you still got it with MSAA off.
     
    Martin_H likes this.
  7. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    5,948
    The issue in the tracker is the same one mentioned in those linked threads, and is an issue that's been there since Unity 2.0.

    The issue in this thread is likely related, if not exactly the same, but there's clearly something additional happening here that the op is leaving out.

    @roberteker You mention image effects, is that the reason the blue line can be seen "through" the legs, and why the foreground leg is significantly more grey than the rest?

    Image effects that used depth don't play nice with MSAA, for the same reason why the directional shadows don't. The camera depth texture does not use MSAA. You can find my post on how to improve directional shadows when used with MSAA linked to in some of those threads. You could use a similar technique to improve your "post" effect, but you would have to do it as a "pre" effect like the directional shadows that the forward rendered shaders sample from, or use a projector.

    Once the new forward renderer is finally implemented, the shadow problem will go away, but the depth based post process issue won't. Not with out a ton of additional custom work that's not yet possible.
     
    Arsonistic likes this.