Is there a way to display a Godot scene 'in' the UI? (Basically Godot's SubViewport Control) #7
-
Hello, I got a pretty simple question, hopefully with a simple answer. I was wondering if there is a way to display a scene 'in' the Avalonia UI as apposed to just overlaying the UI on a scene? Like the SubViewport control in Godot. Thanks! :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hello, Unfortunately, this isn't supported: there is currently no way to embed Godot in Avalonia. This is basically the reverse of Estragonia, which I'm interested in developing once we have a proper Godot library. Note that Estragonia uses a Godot SubViewport to render the Avalonia's tree, so you can reuse its texture where you want in Godot (for example have your UI displayed on the mesh of your choice), it's not only a simple screen overlay. |
Beta Was this translation helpful? Give feedback.
It should be possible in theory. They're all Vulkan images at the end of the day, so one can render a Godot viewport to a texture, get the underlying Vulkan image, and use Avalonia's GPU interop to manipulate it. Setting up the correct Vulkan fences to get all that to render correctly is probably the hardest part.
What use case do you have in mind? You should be able to render Avalonia in Godot using Estragonia today, add some control as a placeholder to where you need a scene to be rendered, and transform a Godot's SubViewport to match its position and size - all that without any new GPU interop. A bit convoluted, but it should work.