Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by stan4u · Jan 11, 2015 at 06:05 PM · androidguirendertexturekeypressflickering

unity3d android gui flickering rendertexture GL.Clear

Hi,

I have a problem with GUI flickering on any key or mouse input when GUI is rendered in script in OnGUI method with render texture active set to texture. Then this render texture is attached to material added to Quad in front of standard camera. shader does not matter, tried any even simple diffuse.

It is happening if following is met

  • OnGUI has set active render texture and any GUI is rendered to this texture. RenderTexture.active=mytexture;

  • There is GL.Clear(false, true, new Color(0.0f, 0.0f, 0.0f, 1.0f)); in the OnGUI to clear render texture. Funny enough the flicker is present if color is with Alpha value (can be any alpha value even 1.0) but it is not present when using Color.black for example.

  • If I call GL.Clear in every OnGUI call GUI is drawn properly on texture and flickering is happening only when you press any key or mouse button. If I call GL.Clear like every half a second, then flicker is present every half a second on each clear and it does not happen on key or mouse press anymore.

  • it is happening when project is switched to Android. If I run the same in editor on Mac with project set as standalone flickering can be seen in scene view but not in the Game view.

I'm running out of ideas how to solve this. I ned this working on Android and with alpha color clear of GL. On joystick input this flicker is very annoying.

Here is simple empty project with just 2 objects in scene to demonstrate this. Make sure you switch project to Android before running in editor and then press key on keyboard when running. https://dl.dropboxusercontent.com/u/22506069/uiRenderTextflicker.zip

Just to note, I'm running on latest OSx 10.10 something and latest Unity pro 4.6.1f1

I appreciate any ideas. Thanks.

+++ Update +++

Here is a screen recording of the problem https://dl.dropboxusercontent.com/u/22506069/guiFlicker.mov

and here is a code of only script in the scene

 using UnityEngine;
 using System.Collections;
 
 public class renderGUI : MonoBehaviour {
 
 
     public RenderTexture rentext; 
     private float lastCleared = 0;
 
     // Use this for initialization
     void Start () {
     
     }
     
     // Update is called once per frame
     void Update () {
     
     }
 
 
     void OnGUI(){
 
 
         RenderTexture.active=rentext;
         //if (Time.time-lastCleared>0.005f){
             GL.Clear(false, true, new Color(0.0f, 0.0f, 0.0f, 1.0f));
         //    lastCleared=Time.time;
         //}
         
         GUI.Button(new Rect(50,50,300,100),"Hayyyyy");
 
         RenderTexture.active=null;
 
 
     }
 
 }
 
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image stan4u · Jan 11, 2015 at 05:38 PM 0
Share

Hi, updated the question with code and screen recording

avatar image stan4u · Jan 17, 2015 at 10:45 AM 0
Share

Is there anyone drawing UI on texture? is this happening only to me or is the sample project giving same result to you as well?

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Unity 5 GUI fllickering, artefacts on Android 3 Answers

Text To Texture/Image 1 Answer

Android Options Menu 0 Answers

Is there a way to scroll GUI text WITHOUT scrollbars? 2 Answers

Unity 2d mobile android GUI texture button 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges