you can even use egui with bevy and have an entire game engine.
Indeed, but I specifically don't want an entire game engine. I want a UI with an embedded 3D view.
Dealing with subpar clones of the whole text rendering, IME, and accessibility stacks just to get an embedded 3D view is not worth.
The vast majority have pointed to tools that do the opposite: they render the UI into my 3D context, not tools that can render my 3D context into their UI.
This is a fundamentally different approach, with significant tradeoffs: you are accepting non-native controls, text layout, IME, accessibility, no direct compositor integration, and re-renders affect the entire UI (not just the 3D viewport).
The browser shell offers a mature text engine, native IME integration, robust accessibility support, access to a wide selection of controls that behave exactly like their native equivalents, and the canvas element is distinct from the rendering model of the surrounding UI elements.
It's not a panacea, but its significantly more advanced than something like egui.
I would rather be doing that, yes. The options to do that without moving all my UI into the 3d context are however slim
And of course, no need to use Go, you can use C, there is a nice wrapper for C++. You can also build IUP.xcframework and use Swift if you like, and there is a bindgen example that can generate Lua and Python bindings, or can export API model as JSON so you can generate whatever bindings. Simple C API based on IUP and attributes, but very poverfull. Nice docs and 200+ examples, retained, standard events and callbacks, should be easy to start and fast to build native apps everywhere.
For example, say your UI is drawn with OpenGL, but you need an embedded Vulkan canvas. This takes a huge amount of API-specific code passing API-foreign texture handles and synchronization objects between contexts. You need to do this for every possible combination of APIs, and it's not symmetrical (hosting Vulkan within OpenGL is different from hosting OpenGL within Vulkan).
Every desktop-class rendering API does have extensions for dealing with foreign APIs, but it's a lot of work, to the point where rendering into shared memory from a subprocess is sometimes the most viable option.
See this is high on the list of things I do not want. I don't want my UI rendered from scratch in OpenGL, I want it drawn using the native widget API, which already supports embedding 3D canvases.
This is one of those things that is completely trivial in, say, Cocoa, but arbitrarily hard in most cross-platform UI toolkits.
On a Windows desktop, you have D3D11 and below, D3D12, Vulkan, and OpenGL. I believe you can do most of it if you're using GDI, but even Microsoft's own myriad of UI frameworks have spotty support.
The other issue in this bucket is being able to embed a 3D rendering context into the UI.
None of the native rust UI toolkits I tested at the time supported this, and I ended up using Tauri -> HTML-Canvas -> WebGL for what ought to be a native app.