The issue with those is that most RectTransforms present in the hierarchy will now depend on each other, so the calculation becomes more complex. However, your CPU will have a harder time if you are using auto-layout components to ease your UI design workflow, such as vertical layout groups and such. RectTransform calculation: this is pretty much free in simple canvas hierarchies. Optimizing the CPU for UI PerformanceĮvery time you add a UI component in your scene, you are adding CPU overheadĮach component increases the CPU cost for the following reasons: Let’s move on, I can’t wait to show you the CPU side of Unity UI Optimization! For more CPU performance, you will need to reduce the amount of graphical elements present in the hierarchy.If you want more GPU performance, you will have to focus on finely tweaking graphical elements and avoid element stacking.The easier you want the UI design workflow to be, the less performant your UI will be.You will get to understand all of it.įor now, you only have to understand one thing: in the end it will be up to you to find the balance between the three variables in your game.īefore we start with each component, have a look at these general rules: That’s alright, because we are going to cover each section separately. I would like you to have a closer look at the attached Guru’s UI Development Diagram. It’s very challenging to perform in every aspect, unless you are very experienced and you have the right tools. The cost of the three components rely mostly on you, but they sometimes counteract each other. Unity offers you some tools to make it easier for you, e.g. You spend time every time you design or maintain your UI. Lastly, the developer pain is paid in time. This means, stacking layers of graphics on top of each other. You pay the GPU resources mostly in concept of overdraw. The more of those you have, the more strain you will put in your processor. You can think of them as UI components, such as images. You pay the CPU toll mainly when generating and submitting batches of UI. I want to give you a short overview before we start digging in the topics. Those are the main resources you will have to spare when developing UI. ![]() There we see three big chunks related to Unity UI Optimization: CPU, GPU, and Developer. I decided to call it The Guru’s UI Development Diagram. Level 2 Unity UI Developer: The Guru’s UI Development Diagram Level 2 Unity UI Developer: The Guru’s UI Development Diagram Today, I will give you one of my most powerful tools: The Guru’s UI Development DiagramĪs usual, I’d like to start with the Level 1 Developer construct. But this takes time and project experience. In my opinion: no matter your role, you should understand basic Unity UI design principles. They rather want developers who create visually stunning interfaces, but also performant.Īnd even in the indie development scene, where would you choose to spend your time on? Bringing fun to your players, or spending hours clicking through the profiler to find bottlenecks? In my experience in the professional sector, companies do not want developers who design poorly optimizable interfaces and leave the tuning task to experienced programmers. That is, for your client to ask you to do over-hours to get your shit together. In my opinion, there’s something even easier than that. It is SO easy to do it wrong, SO easy to get frustrated. If I had to confess anything to you today, it would be this: I wished I had had a solid foundation on Unity UI before I designed the UI of several games. ![]() However, its mightiness can quickly transform into a deadly weapon if it falls into inexperienced hands. Yes, Unity UI is a powerful tool and I love it. Or, if lucky, you know it from first-hand experience. ![]() You probably heard that optimizing UI in Unity is challenging. I read forums, best practices, Unite videos, read all blogs I could find on that topic and did my own research.ĭid you ever experience this feeling of slowly getting overwhelmed by technical debt? It accumulates over time and someday you either give up or decide to crush it. So, I decided to gather every single resource I could find about user interfaces in Unity, because that was the biggest hurdle I was dealing with for several weeks. Stop the excuses, you are becoming a professional today. That morning though, I said to myself: Rubén, this is enough**. The thing is, I owed my clients results but I had no idea how to bring them. Clearly enough, that had to stop working at some point. I had done things too quickly, without really understanding them. I spent the entire weekend worried about all the technical debt I was accumulating over the months in one of my projects. I still remember that weekend, about five years ago…
0 Comments
Leave a Reply. |