Declarative WebGL scene graphs inside Svelte.
This is not even close to production-ready. It's missing many essential features, and isn't optimised. The API is certain to change in substantial ways. You have been warned.
If you're not fazed by that sort of thing, and would like to help figure out how to make this all work, contributions are very welcome.
Someone once described the DOM as 'an API that only a mother could love'. Clearly that person had never tried to build anything with WebGL. Hand-written WebGL code is phenomenally ugly and confusing.
Because of that, people typically reach for libraries like Three.js and regl. I use and love both, but they each have characteristics that make them unsuitable for certain tasks:
Meanwhile, A-Frame — which is a web component wrapper around Three — has demonstrated that a declarative markup-driven approach provides a great authoring experience, particularly for certain kinds of scenes. Since it builds on top of Three, it inherits its strengths and weaknesses.
@sveltejs/gl is several things:
Check out this demo to get started. There's not much point writing docs until things are a bit more settled.
Some of these may be a bit pie-in-the-sky:
requestAnimationFrame
instead of the default one, since the refresh rate on VR devices can be 90 or 120fps)MIT