Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

OSX Standalone Graphics Issue (Case 639431)

Discussion in 'UGUI & TextMesh Pro' started by jdyeager, Oct 13, 2014.

  1. jdyeager

    jdyeager

    Joined:
    Aug 18, 2008
    Posts:
    29
    I'm seeing a very strange graphics issue with standalone OSX builds. It seems to be related to not having a camera in the scene, but I'm not sure. Basically a lot of garbled graphics appear behind UGUI elements in our start scene. The scene doesn't have a camera since all our UI is Screen Space - Overlay.

    Adding a camera to the scene seems to fix the issue for builds on my machine, but other users have reported seeing the same graphics issue whether a camera is added or not. The attached screenshot shows a single frame of what we're seeing, but the actual effect is much worse because it's constantly flickering. The UGUI elements stay constantly visible while everything else on the screen is flickering badly.

    I should also mention that I don't see this at all in the editor. It is only in builds.

    Anyone else seeing this on OSX? I was able to reproduce this with an empty project with no camera in the scene.

    Thanks,

    - Josh
     

    Attached Files:

  2. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    If you think about it, you do need some camera in your scene, otherwise your Overlay doesn't have anything to overlay, if you see what I mean. A camera which has culling mask 'Nothing' and clears to solid black would do the trick; with no cameras Unity doesn't automatically clear the screen for you.
     
  3. jdyeager

    jdyeager

    Joined:
    Aug 18, 2008
    Posts:
    29
    That... doesn't make sense. For one it would mean that Sceen Space - Overlay UI... which doesn't require a camera... actually does require a camera. Just in a very non-obvious, well-you-should-just-know kind of way.

    It would also mean that the behavior of my scene is different in standalone OSX builds by design since I don't see this issue in the editor or on Windows.
     
  4. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    Well, it does. It's an overlay. That implies that it's overlaid over something - ordinarily a 3D-rendered view as seen through the ordinary Main Camera.

    Note that you could probably also handle this by adding a 'background' image element to your canvas - a big black image stuck behind everything else. Then you'd be overlaying over garbage but just rendering black on top of it. Clearing with a camera is more efficient though.

    It's not by design, but when you don't clear the backbuffer, its content is "officially undefined." Some drivers might clear it to black in some situations; some drivers might give you the previously rendered frame; and some drivers might give you a random chunk of graphics memory containing god knows what.
     
  5. jdyeager

    jdyeager

    Joined:
    Aug 18, 2008
    Posts:
    29
    Yeah, I think what I'm generally seeing is the 'god knows what'. I'll give the camera a shot. Just feels like a workaround for something that isn't handled properly more than anything else. Thanks for the help.

    - Josh