-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: 3D application development support #2334
Comments
Hi @vrenken, Yes that all sounds quite do-able, however I don't think it's currently in the scope of core Avalonia - we've already got enough to work on ;) If you'd like to start such an initiative however, you'd have full support from me! If there would need to be changes to Avalonia itself we could try to help. |
To answer your questions:
As an aside: I've used WPF's 3D support and found it to be sorely lacking, which is possibly why I don't think I've ever seen it used, and why it was removed for UWP. I don't think WPF's example is one to follow... |
@GeorgeS2019 have you tried using the old WPF's Viewport3D with Viewport2DVisual3D? If we'll start adding 3D support to Avalonia core, that most likely be our API model. The main problem with using Avalonia as a 3D engine would be the fact that you'll have to create the whole 3D engine. Right now the only thing we have is a PR that allows custom OpenGL context creation and a way to use OpenGL texture as a bitmap (there is also a convenience gl control). |
@kekekeks U jumped too fast to a wrong interpretation of what I have written :-) sorry for not explaining myself clearly :-) I am seriously thinking of a translation layer that convert XAML (excluding the WPF3D part in phase 1) to 3D UI (under an open source 3D engine like godot) in VR/AR I need some tips (the light weight version, perhaps starting with some XAML prototype, before Avalonia) just to provide the bare bone XAML to just convert the UI (2D size, color attributes) to corresponding 3D UI. Then the interactions. Later, the MVVM from WPF to mono MVVM. |
Our XAML compiler can be used as a standalone library, everything Avalonia-specific is implemented via custom AST transformations. If you only need to compose object graphs, it can be used without extra tweaking. |
Hi @kekekeks, that standalone XAML compiler sounds like the spot-on approach. Somehow I missed it during my initial scan in february 2019. Many thanks for sharing! Thinking somewhat further: With a standardized XAML schema and a (Reactive) MVVM approach such a setup could even be used to standardize cross-3D application development. In other words the XAML code gets translated into a Unity/Godotnet/whatever node hierarchy which gets its behavior powered by ViewModels and Models. In my humble opinion this has some very serious advantages:
Sorry for my rantings - just got enthusiastic about the standalone XAML compiler. Best regards, Peter Vrenken |
I am investigating building a runtime compatible with Veldrid. https://github.com/mellinoe/veldrid |
@vrenken |
You could add support for something like Monogame, Gemini or another similar library instead. |
I would also love to see a way to display a Monogame buffer in an Avalonia window - this would open up a whole new realm of possibilities! |
I naively assumed this was already possible. I'm in the process of porting my XNA engine and editor to Monogame and Avalonia so it can be multi-platform. Being able to render whatever I'm doing in Monogame inside of Avalonia is a must for me! After a bit of digging around in the source code, I stumbled upon Avalonia.OpenGL and was under the impression it wouldn't be too hard to port MonoGame.WpfCore using that but maybe it's not that easy? I'll admit that I didn't look into it too much so this is all based on assumptions. It's not a priority for me right now, the engine takes precedence but if porting MonoGame.WpfCore is already possible then I might give a shot at some point. |
See #9925 Avalonia also supports Rotate3DTransform and possibility to apply third dimensional transformation matrices, but it's more limiting, if you need to have custom low-level rendering inside of the avalonia. See https://github.com/AvaloniaUI/Avalonia/blob/master/samples/RenderDemo/Pages/Transform3DPage.axaml |
Stumbled over Monogame integrations for Avalonia: |
Hi,
as one of the tech-guys involved in today's stream of VR/AR applications I've got the feeling that this domain lacks mature application architectural patterns which have been common in mainstream desktop/web/app development. Traditionally 3D (VR and AR) applications are build using game engines (Unity3D, Unreal, UrhoSharp etc..) which all operate according to the Entity Component System paradigm.
Although a lot of splendid 3D applications can be seen on Youtube I personally get the feeling that the current method of 3D application develop would dramatically benefit from concepts like XAML and MVVM (or MVP/MVC for the matter). Especially in today's time where 'enterprise-grade' applications are being requested.
Because of this I've been tracking PortableXaml and AvaloniaUI for a while now (kudo's to everyone involved), and have started tinkering with some basic tests to see how a XAML+MVVM could be formed and molded in a way that makes the two usable for both 2D -and- 3D application development.
To express some of my thinking - In an ideal world:
To make a long story short my questions are:
Anyways thanks for all feedback/ideas & keep up the great work on AvaloniaUI!
Best regards from Germany,
Peter Vrenken
p.s. I couldn't find a forum on which to ask this question so I've taken the liberty to use a feature request to trigger a dialog. If this isn't the right place to initiate such a dialog then please feel free to direct me to somewhere else.
The text was updated successfully, but these errors were encountered: