Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

UI Flicker (Screen Space Overlay -> Render Texture)

Discussion in 'UGUI & TextMesh Pro' started by Polymorphik, Dec 23, 2015.

  1. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    I have a Render Texture for a mini HUD for the center console of my cockpit. I want a UI to be displayed there so I decided to use the Unity UI interface. The HUD on the center console is via a Render Texture. I used a simple image to test out the scaling and when I move my ship the image flickers in an out of phase.

    I tried changing the clipping, and plane distance with no solution. I really need the UI to work on the center console as it is crucial for in-game feedback.

    If anyone has experienced this problem and has a fix I would be indebted, thanks!

    Specs
    OS: Windows 8.1 Pro x64 (Bootcamp -> MacBook Pro late 2014)
    Hardware
    CPU: i7-4558U 2.8 GHz
    RAM: 16GBs
    SSD: 500 GBs
    GPU: Intel Iris Pro (Possible GPU problem who knows)
    Unity: 5.2.3F1
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,850
    Is the flickering z fighting between the console and the texture? Its hard to say without seeing it.can you not use a world canvas instead of render texture?
     
  3. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Thank you for getting back to me. I am working on Bootcamp so I don't have a native screen capture.

    Here is a screenshot, imagine the Red Square jittering ever so slightly as if it was 'catching' up, similar to how some cameras get jitter when following a player in Update when they move in FixedUpdate. And I did notice the Z axis for w/e reason was changing between -0.1 and 0.1. Here is the Hierarchy View.
     
  4. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Here is a video, sorry did it with my phone.
     
  5. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Its likely a issue with when the rendertexture is rendered. I'd try rendering that camera manually in a update loop to see if that helps.
     
    karl_jones likes this.
  6. DaveCrowdStar

    DaveCrowdStar

    Joined:
    Nov 13, 2015
    Posts:
    13
    I have the same problem and have found that rendering in the Update loop manually does solve the problem.

    However, I'm a little confused by this in general. Why doesn't it work in the normal Mono lifecycle? usually all of my monos update and I don't control the order. So I can set this mono to update later, but I feel like normally there is a clear Update then Render flow.

    Even when I flip a bool and then wait until the next frame and flip it back, the render texture gets garbage in it. It only works when I manually call render from the update loop.

    Why does it make sense to call Render from the update loop and not somewhere else?