Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by McMayhem · Mar 12, 2016 at 11:40 PM · uimaterialrendertexturequalitysettings

[UI] (RenderTexture & Material) Breaks on SetQualityLevel

Hello all.

So I’ve had this issue actually since 5.2. It wasn’t as big a deal then because the issue only happened in the editor and not in the build. Now it’s happening in the build too so I figured I would share and see if this is really a bug or if it’s just something I’m doing wrong.

What I’m Doing: I’m rendering my game’s HUD using a separate camera. The normal camera layering technique as seen here is no good for me as I’m using Deferred Shading as well as image effects on the UI camera. I also can't use the standard Screen Space Camera canvas because I'm using AmplifyMotion which distorts the UI when it's set to that.

So my only alternative was to render the UI to a RenderTexture and then use that in a RawImage on my Overlay Canvas that renders the normal, non-bloomed UI. The effect creates something like this:

alt text

Problem: Everything works beautifully under normal conditions. You can start, load, save, quit and the HUD doesn’t freak out. The only issue is when you change any of the settings that requires expensive SetQualityLevel calls. When applying changes, the settings code calls the necessary SetQualityLevel() for whatever options were set. Once this happens, there is a divergence in behavior from the EDITOR and the BUILD.

EDITOR: I lose the HUD and only have the Overlay UI visible.

BUILD: Screen turns white and the game must be exited manually.

After researching for quite a while, I’ve discovered this is an issue with the MATERIAL attached to the RawImage that is using the RenderTexture.

I’ve found that if I delete the material, the RenderTexture image shows up just fine. Of course, I need the material in order to get rid of the black background so you can see stuff behind the HUD.

TLDR: Calling SetQualityLevel() for things such as AA and Shadows globally breaks RenderTextures when used with a material of any kind. Not sure if this is a bug, or if there is something I need to do after applying graphics settings to get it to work again.

Things I’ve tried: - Resetting the material. Adding a new material. Swapping materials. (no matter what I do to the material property of the RawImage component, it still won’t show anything with the material property set to anything other than “none”.) - Destroying the RenderTexture and creating a new one. - Setting the RawImage as dirty - Programmatically removing the RawImage and replacing it with a new component. - Using Graphics.DrawTexture to draw the image instead of the UI. This loses its information when using SetQualityLevel() as well. No material used. - Searching for similar, solved issues.

Comment
Add comment
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

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

67 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I accidentally changed the default UI Material. How can I change it back? 1 Answer

Corrupted default ui material 0 Answers

So, tiling textures in UI Materials in not a thing? 0 Answers

Hot to use Defuse Material in UI? 0 Answers

RenderTexture via UIBuilder 0 Answers


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