4 ms·
Hmm. I’m a big fan of immediate mode myself, because it’s kind of amazing how much you can actually push through via brute force. However, wouldn’t you agree
by boulos 6y ago
Hmm.
I’m a big fan of immediate mode myself, because it’s kind of amazing how much you can actually push through via brute force.
However, wouldn’t you agree that Unity, Open Scene Graph, etc. are successful counter arguments?
I would say it depends on your audience. The bottom layer of the stack might be a very simple retained mode, or fully brute force immediate, but it’s not clear to me that a “UI framework” for application developers should be immediate mode.
- stephc_int13 6y agoIn my opinion, the reason why immediate-mode API are so efficient and practical is because it helps to avoid structure duplication. An UI, from an abstract point of view, is nothing but a big structure. When you're writing an application or a game, you very often already have an existing structure containing everything you need. Take a simple example : a leaderboard. Using anything but an immediate-mode API will force you to create a second, complex structure to hold this leaderboard, and a lot of glue code to copy data to and from this structure.
- boulos 6y agoInteresting. I think that argument is “people can’t usefully agree on common abstractions, why bother forcing a translation”. And so for users of scene graphs, it’s basically “well, we can all agree there’s a basic graph and bounding boxes are a thing” so you’re not giving up much. But for UI, is the argument that it’s often more like drawing/painting, so you spend more cycles (in both mental and processing senses) on trying to express the thing you already knew you wanted to achieve?
- learc83 6y agoI don’t know. Unity is completely redoing their UI stack, so I don’t think even they are happy with the current incarnation.
- stephc_int13 6y agoIt is absurdly easy to make a sluggish and extremely memory inefficient UI with the old Unity API. I've seen that made many times.
- boulos 6y agoI meant Unity in the “you’re my game engine / scene graph” sense. Like why are game engines and scene graphs fairly successful, yet the comment I replied to is arguing “clearly retained mode doesn’t work”.
- learc83 6y agoThe hierarchy in a game object scene graph tends to be much shallower than a UI hierarchy, so I’m not sure if that is a good comparison.