FyroxEngine / Fyrox

3D and 2D game engine written in Rust
https://fyrox.rs
MIT License
7.51k stars 341 forks source link

Question about the plan: Do you have any plans regarding web UI? #456

Closed PlumpMath closed 11 months ago

PlumpMath commented 1 year ago

Hello

I'm not into gaming, but I'm very interested in creating 3D apps. I want to use Tauri's webview to create the UI with a mix of web technologies. I have just set up the build configuration on NixOS and Nix-darwin, and I'm almost done with the build setup. I would love to be able to integrate it with Tauri.

mrDIMAS commented 1 year ago

Hi, short answer to the question in the title: no.

Fyrox has its own very powerful and flexible UI system, that should be used when you need to make a UI. The editor made with this UI system and should be a good proof of the previous statement. I think potentially it is possible to embed Fyrox in an arbitrary canvas on a web page, however this will require some changes (small) in the engine initialization.

PlumpMath commented 1 year ago

I don't think there would be any problem since there is a wasm build available, but it would be really great if it could be combined with Tauri in the future. The reason is that it would allow for direct native rendering quality and improved performance. I struggled a lot in choosing a game engine, and I was hoping for an engine like web UI (Tauri or wasm+web). So that's why I asked.

In the past, I attempted to combine x3dom web rendering with my work (other engine), although I gave up due to issues with axis-related & camera matters. However, I have often imagined how amazing it would be if such rendering and composition were possible, not only for games but also for other applications.

Thank you.

Type1J commented 11 months ago

This issue is more on the Tauri side, I believe.

There was a paid library caled "Awesomium" ... or something similar... that was meant to be an embeded web browser for game UI. The main feature of the library was the ability to render to integrate with the game engine by generating vertex buffers and textures, and there were several glue libraries for popular engines.

ScaleForm was almost the same thing except with Flash instead of HTML.

Tauri is meant to be a lightweight web browser by using the platform built-in webview. It could have an API added in the future to render to a texture, and you'd get what you're describing.

However, I believe what you want is only availible, at this time, in a "bring the whole browser engine" form, such CEF (Chromium Embedded Framework), which has a C API that I believe includes a render to texture somewhere.

Personally, I believe that the web is too heavy for games. Games can be made for the web with WASM, but the web platform itself has been too guarded and has become too complex for embedding it just for a UI. You're in a much better position using something like egui, which even has a template for making an app that can be recompiled as a website, and a demo site, or, even better, Fyrox UI

The web doesn't get you very far. You need something like Material UI to do anything useful. Think about what happens when you start wanting to make a UI in VR. Even in THREE.js, VR UIs can't use web elements, but egui and Fyrox UI can be used.