Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Is it possible to use MAUI as a 3D GUI? #348

Open
MiheevN opened this issue Mar 18, 2022 · 9 comments
Open

Is it possible to use MAUI as a 3D GUI? #348

MiheevN opened this issue Mar 18, 2022 · 9 comments

Comments

@MiheevN
Copy link

MiheevN commented Mar 18, 2022

I need to render MAUI inside or on top of 3D space, as well as in the form of 3D textures - widgets. Like in game engines.
Is it even possible with this project.

For example, there is Veldrid, and the corresponding theme:
veldrid/veldrid#443
Where I was advised to apply here again

Maybe someone can tell me which projects I should study, for example
Microsoft.Maui.Graphics.Blazor
Microsoft.Maui.Graphics.Skia
But so far I don’t understand at all how to get a rendered image, which can be displayed simply in a picture, and thrown into a render.

You can count my skills as 0, explain like a baby, but the zeal is endless.
Since I definitely need a 3D GUI

@Timmoth
Copy link

Timmoth commented Apr 20, 2022

Its not suitable for 3d graphics, of course its possible to rasterize a 3d image onto a canvas pixel by pixel using your own renderer but this wouldn't be taking advantage of your GPU and would be very inefficient (and complicated).
You'll be better off learning openGL then using something like Veldrid or Silk.

Best of luck.

@MiheevN
Copy link
Author

MiheevN commented Apr 20, 2022

@Timmoth I already use Veldrid! What is written in the post.
But UI and 3D graphics are two different things...

How exactly do you suggest that I effectively draw buttons, forms, tables, etc.?

I'm looking for a method that allows me to create an interface plane, display images from it, and enter keystrokes and mouse clicks.

@Timmoth
Copy link

Timmoth commented Apr 22, 2022

What exactly do you mean by a 3d gui?

If you are talking about rendering a user interface in a 3d environment you could look at something like imgui?
(Note there's a imgui wrapper in silk .net)

@MiheevN
Copy link
Author

MiheevN commented Apr 22, 2022

@Timmoth
Yes, ImGui creates an interface, but a primitive one. It doesn't suit me at all, unfortunately.

But Need limitless complexity, Blazor is perfect for the moment.

Requires NOT LESS than an interface similar to that of a website.

@Timmoth
Copy link

Timmoth commented Apr 22, 2022

Why not use html / css then?

@MiheevN
Copy link
Author

MiheevN commented Apr 22, 2022

But how? what libraries? what methods? what will the code look like? there are examples? After all, Blazor is Html+Css+JS...

@Timmoth
Copy link

Timmoth commented Apr 22, 2022

I'm afraid I think your asking in the wrong place for that! Maui graphics is for rendering 2d graphics onto a canvas, if you are after creating a nice interface I'd recommend looking at a css library like bootstrap or tailwind. It is possible to achieve 3d looking results in css - a quick search showed this showcase https://bashooka.com/coding/css-3d-design-examples/

@Timmoth
Copy link

Timmoth commented Apr 25, 2022

@MiheevN, I've created a simple demo app that shows how you might achieve some 3D graphics on a canvas - whilst it is possible - it is extremely inefficient (does not take advantage of the GPU for all the matrix operations) not to mention alot of hard work for complex scenarios!

image

Maui Graphics 3d Demo

@MiheevN
Copy link
Author

MiheevN commented Apr 26, 2022

@Timmoth Also a good and useful example, which will undoubtedly come in handy. Thank you!

But unfortunately not exactly what I need.

I already think that I just need planes for the Blazor Site / MAUI render.

Once again thoroughly, WHAT IS REQUIRED:

  1. Object similar to
UI_Instance.MoveCursor(10,20);
UI_Instance.SendMouseEvent(Events.LeftMousePress);
Span<Rgba32> CurrentFrameImage = UI_Instance.Render();
  1. The ability to OVERLAY the interface on top of 3D, and not just render inside. But it solves Span
    Although Render inside will also be very useful. But it is desirable for him to be on the GPU. But it should be easy when the first thing is decided.

  2. Infinity of instances. For example, a lot of cubes = textures, and on the plane of each there is its own Interface Instance.

  3. The ability to open websites just as easily.
    What makes it possible to simply make a Browser Object, and run a Blazor Instances inside...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants