autonomous-metaverse / aingenuity

unnamed experiment
3 stars 3 forks source link

convert from regular DOM/CSS UI to WebGL-powered UI so that we can render it inside WebXR. #13

Open trusktr opened 1 year ago

trusktr commented 1 year ago

DOM/CSS UI is not currently able to transcend into WebXR space, so we need to come up with method for UI inside WebGL. One of these approaches:

  1. Render basic DOM/CSS to canvas using the SVG trick, which has limitations on what CSS features are supported, and a bit of performance cost every frame.
    • This might be the simplest way to support a wide set of UI capabilities already built into the browser, to leverage it in WebXR.
  2. Create a UI system out of WebGL primitives
    • This is perhaps more complicated than option 1, but will eventually yield better results: full control over rendering inside of WebXR without limitations, and more performance.
    • We can to re-implement things like text flow, font rendering, etc (for which some libraries for Three.js already exists).