Replies: 15 comments 5 replies
-
You could lookup Last possibility would be embedding native window which is pretty much what you are already doing in wpf with downsides you mentioned except you dont have to bring whole win form, all you need is native handle of window (can be obtained via interop or via windowing lib) - and if you really need overlaying controls over your rendering you can simulate it via floating windows with owner window set to make sure they wont go below main window |
Beta Was this translation helpful? Give feedback.
-
Understand. Thanks. Do I understand correctly, Avalonia UI scene graph is always rendered using OpenGL? |
Beta Was this translation helpful? Give feedback.
-
I believe it is opengl es via skia lib actually to make porting to mobile easier although im not 100% certain since im not maintanainer |
Beta Was this translation helpful? Give feedback.
-
Skia is our main rendering backend but we have a Direct2D1 backend also: https://github.com/AvaloniaUI/Avalonia/tree/master/src/Windows/Avalonia.Direct2D1 It's not as well maintained as the Skia backend so you may encounter problems but it should work. If this is useful to you, we're looking for a maintainer for it ;) To enable it, add the Avalonia.Direct2D1 package and call |
Beta Was this translation helpful? Give feedback.
-
I'm planning to add |
Beta Was this translation helpful? Give feedback.
-
@kekekeks would be nice if you could abstract away these bitmaps behind something like |
Beta Was this translation helpful? Give feedback.
-
I think we need to solve in common way the hosting part, game engines uses d3d12, d3d11, vulkan, opengl or metal nowadays, there is need to have common ways of hosting game engine view into Avalonia, I know gritgene is using Avalonia for editor and I plan to do the same, would love to help with PR as well. |
Beta Was this translation helpful? Give feedback.
-
GritGene is using a custom ISkiaGpu implementation and ICustomDrawingOperation to integrate with our rendering pipeline directly. While that being viable, I'd still prefer the old good render to texture and use as a bitmap approach. For that we need to support platform primitives for surface sharing.
|
Beta Was this translation helpful? Give feedback.
-
@kekekeks Very helpful. Thank you. Can I find a sample implementation of the ISkiaGpu/ICustomDrawingOperation sample somewhere? |
Beta Was this translation helpful? Give feedback.
-
@llfab I'm currently working on OpenTK integration and coincidentally that requires DXGI support from our rendering system. So I'm planning to add something like
next month. |
Beta Was this translation helpful? Give feedback.
-
@kekekeks That sounds good. Let me know when there is something that we can try. |
Beta Was this translation helpful? Give feedback.
-
@kekekeks sorry to ping, but I was wondering if there is any update on OpenTK integration? I've been trying using OpenGLControlBase, but it looks like it has problems with multiple textures. |
Beta Was this translation helpful? Give feedback.
-
Sorry, I'm suffering from post-covid complications, will continue OpenTK once I get better. |
Beta Was this translation helpful? Give feedback.
-
Sorry to hear that, all the best to you! You guys are doing a great job with Avalonia 👍 |
Beta Was this translation helpful? Give feedback.
-
This feature would be great, if we could have a rendering surface of our own while it is treated as a normal Avalonia control so you can overlap it with other content. MS didn't do that so many years and I don't think that they will ever do it (even in MAUI/Win UI 3). I'm mainly interested to use it for video playback with my custom d3d11 renderer. |
Beta Was this translation helpful? Give feedback.
-
We are considering to use Avalonia within our .NET 5 based framework. We have our own 3D renderer which is based on DirectX 11. This renderer is currently integrated into WPF. Because WPF is DirectX 9 based, the only option to make our renderer work 100% correct within WPF (unfortunately), was to draw the rendered texture into a Windows Forms surface and use a WindowsFormsHost within WPF tree.
I wonder whether this could be avoided using Avalonia. It would be beneficial to be able to integrate the rendered DirectX 11 texture directly into an Avalonia UI scene graph node. In WPF this would work theoretically (passing the DirectX 11 texture into the DirectX 9 WPF scene graph. However, this works not 100% especially for multiple screens which is why we chose the the stable way with WindowsFormsHost.
The draw back of the WindowsFormsHost workaround ist, that there cannot be any WPF controls overlayed onto the rendered 3D scene (because Windows Forms surfaces are rendered ontop of everything). Hence, a true integration into the Avalonio UI scene graph may bring the benefit of correct overlays and also smooth dynamic resizing.
Of course, this is only targeting Windows target platform.
Beta Was this translation helpful? Give feedback.
All reactions