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

Bug UI Toolkit 1.0.0-preview 6 in combination with Graphics.Blit() causes resize flicker

Discussion in 'UI Toolkit' started by Aniketos00, Aug 1, 2020.

  1. Aniketos00

    Aniketos00

    Joined:
    Dec 1, 2014
    Posts:
    2
    I have currently upgraded from the preview runtime package 0.4 to the UI toolkit and everything works as it did for only 1 weird issue. Where every blend cycle that I execute with the Graphics.Blit() the UI resizes and then go's back to normal which causes a weird flickering effect.

    I have pinpointed the issue to this line of code:
    Code (CSharp):
    1.  
    2. Graphics.Blit(_currTexture, _prevTexture);
    3.  
    I'm not exactly sure why a Projector interacts with 2d runtime UI, but do you guys know a workaround or a solution to this?
     
    Last edited: Aug 3, 2020
  2. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    325
    Hi Aniketos00,

    It's hard to tell what is going wrong without an actual test project. Could you submit one through the bug reporter and post the case number here please? I'd like to have a look at the issue.

    Thanks
     
    Last edited: Aug 4, 2020
  3. Aniketos00

    Aniketos00

    Joined:
    Dec 1, 2014
    Posts:
    2
    Hey AlexandreT-unity,

    I have created a custom project which reproduces this with simple script, just run the SampleScene. The case no: 1268095

    I have attached the solution (I think) if something is missing just let me know.
     
  4. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    325
    Thanks Aniketos00, I was able to reproduce the issue. It's strange, we'll investigate it and get back to you once we have a fix.
     
    Aniketos00 likes this.
  5. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    325
    Hi again Aniketos00. We don't have a final fix yet but a workaround would be to restore RenderTexture.active after blitting.