Open rofrol opened 4 years ago
That's a very interesting question. I spent all morning reading links about scene graph
. From what I experienced, game engines usually organize game objects into trees (GoDot for example). However, the actual phase of rendering, physics calculation or processing game logic may be run in parallel using subtrees and lists of objects that are not, strictly speaking, graph traversal through their parent and child relationships. It is hard to reflect all different aspects of interaction between game objects with just a single hierarchy. There are always multiple angles to look at the same tree. Most obvious two are "rendering visible area" and "game logic interaction between objects". For some things it easier to just maintain a list of all objects using a simple query.
However, for web development, it is uncommon to impose even some kind of hierarchy to the app objects. The DOM tree is one of the kind. And it looks like Elm uses some algorithms for the tree transformation and change detection. These are most likely the ones that most widely used. However, it would be very interesting to know which algorithms exactly. And then look for their visualization to understand how they work. :)
The Elm model
is a good start to research if it is the actual rendering tree, or just a tree, or a mix of things like DOM rendering tree and logic hierarchy. I think there is something mixed in the Elm about it that needs to be decoupled on examples.
Putting the final touch to it, I wonder what a GUI for real-time representation of Elm model could look like?
from https://github.com/elm/elm-lang.org/blob/216a36546c6132d4631468bc0b471768cb3b6daa/pages/news/blazing-fast-html.elm#L90
And then I read this
https://www.reddit.com/r/rust/comments/e04b1p/towards_a_unified_theory_of_reactive_ui/f8pz6q1/
https://www.gamedev.net/forums/topic/464464-anti-scenegraphism-a-tale-of-tom-forsyths-scene-graphs-just-say-no/
Also this https://news.ycombinator.com/item?id=13912670
https://www.reddit.com/r/gamedev/comments/5exges/scene_graph_just_a_question/