tokyodude
Joined 8 years ago
Joined 8 years ago
There's best case for Retained mode GUIs and best case for ImGUIs. ImGUIs excel when lots is changing. In a scrolling mobile app the entire page is being re-rendered constantly as the user moves the page up and down. GUI widgets get created and deleted, data gets marshalled in and out, various algorithms are applied to try to minimize re-creating stuff, all code that doesn't need to be executed in ImGUI mode code.
There are tons of cases where ImGUIs win in perf. In fact the reason they are so popular with for game dev is exactly because they vastly out perform retained mode guis. There's a reason there are 100s of books and 1000s of blog posts and articles trying to get retained mode guis to run smoothly. They almost always fail without lots and lots of specialized client side code to try to minimize GUI widget object creation/deletion, reuse objects, minimize state changes, etc, all that code disappears in an ImGUI and they run at 60fps where as all the retained mode guis struggle to get even 20fps consistently as they hiccup and sputter.
Electron (and nearly all retained mode GUIs) will execute 10x more code trying not to execute the rendering code. Just skipping all that checking and jumping to the rendering code is arguably a win in many many cases.
To put some empirical data on it, game devs use ImGUIs because they keep up with perf where as that 10x overhead of retained mode guis creating gui objects, deleting gui objects, marshaling data into and out of gui objects, adding and removing event handlers and callbacks, and then trying to write a bunch more code to optimize all of that never leads to a GUI that is performant enough for the GUIs needed for game dev.
I think if you check actual apps, especially phone apps, you'll find it's not so clear which one wins. Phone apps almost always move in relation to the users fingers meaning the screen is being re-rendered. Usually new GUI elements are moving on and off the top/bottom of the screen. The overhead of creating/deleting/managing those objects is arguably greater than just re-rendering. The screen is already going to be re-rendered. At best you're getting a few cached textures from your retained mode gui all at the expensive of managing GUI objects.
For desktop apps it really depends on the app. It's got nothing to do with the complexity of the UI and everything to do with what the app does. A text editor might be a win for a retained mode GUI. Photoshop/Maya it's less clear. For example Unity is ImGUI and has very complex UI. Much of the UI has to respond in realtime to the state of the user's document that is changing constantly.
https://greggman.github.io/doodles/glfw-imgui/out/glfw-imgui...
In the "ImGUI Demo" window start expanding the collapsed items or from the menus pick "Examples"
Note that no effort has been spent to actually make the demo web browser friendly so there are rough edges.
One of the most complex apps out there, Unity, is entirely ImGUI based for the app itself and often has 1000s of controls visible. Going though the screenshots of typical ImGUI usage most of them are on the complex side.
https://cloud.githubusercontent.com/assets/8225057/20628927/...
https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v16...
https://user-images.githubusercontent.com/16171743/50757906-...
https://user-images.githubusercontent.com/8225057/51042368-6...
https://user-images.githubusercontent.com/870320/51073482-ba...
See https://github.com/ocornut/imgui#Gallery for more
Some others are "I've said it once and I'll say it again", "as I said/wrote/posted/blogged before". Those seem to suggest the author is assuming they are famous/popular enough that their previous content has been read. Of course you could look at it as they are just suggesting you go read their previous post but for whatever reason that specific way of saying it comes across less as info and more as "of course you read my previous post".
I'm aware this is a personal opinion with no basis in reality.
Also ImGUIs are not multiple pass. That's in implementation detail. Unity's ImGUI is multi-pass. One of the most popular ImGUIs (Dear ImGUI) is single pass
The reasons they switched the in game system are many but they have nothing to do with performance.
When I don't know a term I google it. I don't assume the entire world revolves around me and that it's the author job to make their article more verbose because everyone reading it might not know every term.
Here's are galleries of some from one of the more popular libraries
https://github.com/ocornut/imgui/issues/2265 https://github.com/ocornut/imgui/issues/1902 https://github.com/ocornut/imgui/issues/1607 https://github.com/ocornut/imgui/issues/1269
Note that Uber/Lyft do something the taxi companies can not. They scale to meet demand. If 1000 drivers are needed between 6pm and 8pm then they'll likely get 1000 drivers. Taxi companies can't do this as they'd lose money on drivers and cars when all of them are not in use.