🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Modern GUI

Started by
15 comments, last by Unarmed1000 2 years, 5 months ago

Immediate mode is a joke mode for drawing a GUI. An interface is much more responsive when you make a hierarchy and only draw the regions of the screen that get invalidated. For some games it would be okay, but a complex interface or a desktop application should use retained mode in order for the interface to be snappy and responsive.

10x Faster Performance for VR: www.ultraengine.com

Advertisement

Josh Klint said:
An interface is much more responsive when you make a hierarchy and only draw the regions of the screen that get invalidated.

If it's drawn along 3D rendering, this would need to maintain a copy of the framebuffer and additional complexity, and if GUI is transparent it would not work at all.

ImGui is not bad in this regard. I can draw thousands of elements, and ImGui seems to clip them if they would end up outside the screen / window. Performance impact of UI never became noticeable to me.
The main thing i'd criticize is responsiveness at very low framerates like 1 fps. Then i need to hover, wait a frame for confirmation, only then i can click, but need to hold the button til the next frame again. Things like that.
That's the only cases where i miss my own older UI which was more snappy in such situations. But maybe that's my own fault and caused from my way of connecting ImGui to OS messages.

For the Bevy engine they are discussing this very issue. There seems to be proponents for just about any way of doing it (immediate mode/retained, CSS/in-code etc.). Link: https://github.com/bevyengine/bevy/issues/254

The GUI issue has been solved. HTML/CSS/Javascript are the current and future GUI tech. The easiest thing to do, to get the most complicated GUI working in your game, asap, is to use CEF3.

Use Bootstrap If you make browser WebGL games.

If you are going to design a UI system from scratch I would recommend reading this to get the fundamentals right. Also I would not recommend a HTML based UI system if you are developing a a game targeting high framerates like 240+fps which is becoming a normal thing for gaming. But I would also seriously consider if you have time to do a custom solution as it can be extremely time consuming. The example implementation in this repo is still pretty unoptimized but it can generate and schedule rendering of a pretty complex UI under Vulkan in around 50 microseconds (on the CPU) which leaves plenty of time for other things.

Why do you think that modern cannot be good or vice versa? A good one can also be modern if all the circumstances are taken into account when compiling this hierarchy. And what do these questions have to do with graphic interfaces? What can they have in common if they are even interpreted as something coherent and presenting an analogy. The same question can be asked of you. Many people are now looking for good colleagues with a modern outlook. We were also looking for an icon designer for hire who might have a concept of modernity in common with "good".

This topic is closed to new replies.

Advertisement