Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 ungalyant2 · Oct 15, 2011 at 02:44 PM · guishadersetpass

Lowering the cost of GUI

I recently took the 30 day trial for unity pro to utilise the profiler to see how I could up the efficiency of my game, and I found out that 90% of the time (especially when playing split screen mode) the repaint GUI section was always taking up more than 60% of my MS, I've heard that calling OnGUI has a set overhead cost which ups it by quite a lot, but for me it's actually one of my functions, with 2 cameras it's calling the function 4 times, I have no idea why it's not twice so that's a query, on top of that the shader.setPass call is being called 300 times each call, personally I have no idea what this is doing, but it's taking up a huge amount of the MS, is there any way I can lower this? What does it even do? I only have a few GUI elements, a minimap which is made up of 100 small textures (probably quite inefficient I know, but my maps are randomly generated tiles so the map just makes itself using the same generated numbers, anyone who can think of a more efficient way, your assistance would be much appreciated) and then a line that seperates the two camera views, and that's about it. How can I lower the cost?

Comment
Add comment · Show 1
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 Fattie · Oct 15, 2011 at 06:29 PM 0
Share

many people just say "Don't use unityGUI". $$anonymous$$any other people say "unityGUI is just a scratch tool for development". Ins$$anonymous$$d just simply use the old-fashioned drawtexture, etc. And simply detect touches - after all, it's only a few lines of code with "Rects" galore.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by SirGive · Oct 15, 2011 at 04:13 PM

Unity's GUI is currently very inefficient as it has a high number of draw calls. The way I found to minimize draw calls is an alternative GUI. I'm currently using UIToolkit but there are others out there. One that comes to mind would be EzGUI.

Comment
Add comment · Show 1 · Share
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 Pangamini · Mar 22, 2012 at 10:52 AM 0
Share

Is there any third party GUI that utilizes batching / atlases and has a multiline textarea?

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Strange shader behaviour on UI component 0 Answers

Dirt On Camera (BF3 and Metro Last Light) 1 Answer

How to Make Transparent Objects Blurry 1 Answer

Setting GUI GameObjects to ignore all lighting 1 Answer

Depth Mask / Reverse UI Mask for UI staying on screen even when disabled,Depth Mask / Reverse Mask in UI remain transparent even when disabled 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