(This post is missing links to stuff. Apologies! If you’re a moderator, feel free to add them where applicable)
There has been lots of talks lately about what UI toolkit we could use long term for the editor. Choosing a UI toolkit is a complicated matter as it not only has to be capable enough to fit all of our needs but it also needs to be compatible on a technical level. There has already been a lot of bikeshedding going around this topic and this thread is supposed to summarize most of what has already been talked about. Please remember that we’re a respectful community and trash talking technologies is never acceptable.
The basic requirements
- The toolkit has to have basic components or at the very least facilitate very easy creation of those components.
- The toolkit needs to have easy styling options so that we can match the theme of the editor with the Amethyst branding guidelines.
- The toolkit needs to work with Vulkan in order for us to be able to embed the game output in the editor as our new renderer will basically require Vulkan for the foreseeable future.
That last point is of particular interest as a the only way to have a Vulkan surface display on OpenGL is with OpenGL 4.6, support for which isn’t yet widespread at the time of writing. We may be able to use the OpenGL backend in gfx hal, but that will still be far from optimal.
A prototype has been built already with Electron but electron by randomPoison. The prototype is currently able to communicate with the engine in order to sync and modify state. It’s currently missing any kind of graphical scene editing which is where the Vulkan <-> OpenGL interop becomes a problem again. Electron is also widely known for taking up a lot of resources. The upsides of using electron would be that it’s very accessible because it uses web technology.
The upside of GTK is that it would provide a native look and feel on most Linux desktop environments but that’s basically where the upsides end. There is no point using it if the intention is to theme the editor to the Amethyst branding and we still have the graphics interop problem. The bindings for Rust are also immature.
Qt is pretty much the only toolkit that satisfies all requirements since it has a Vulkan backend and can be easily themed. The main problem with Qt however is that it’s heavily tied to C++. There has been binding generators written for Qt that allows Rust code to essentially drive the logic of a C++ Qt application but it’s unclear if this would actually be a reasonable approach for a primarily Rust based community such as the Amethyst community.
Amethyst is currently undergoing a rewrite of its UI which could potentially be used to create the editor. The problem is that Amethyst is made for games and not UI applications and as such could eat up a lot of resources unnecessarily while also being cumbersome to use because of the differing paradigms. The upsides are that we have guaranteed compatibility with the engine, we have a good way to dogfood the UI side of the engine and contributors of Amethyst will immediately be familiar with the editor.
The desktop side of flutter is somewhat up in the air being only unofficially supported and even if we could get it up and running it would probably have the graphics interop problem.
Azul is probably the most interesting technology being written completely in Rust and running on top of webrender. If we could somehow get it to run on the rumored gfx hal webrender branch that apparently exist somewhere, this could be the toolkit that checks all the boxes without any major downsides. The only potential problem is that it’s still immature but I imagine that we could probably dogfood it quite a bit.
If you have any other toolkit that you know of that could do everything we need it to, don’t hesitate to tell us about it!