Replies: 2 comments 5 replies
-
|
Thanks for filing this — interesting idea. Quick context: Bloom's renderer is already built on wgpu under the hood, which is basically a 1:1 implementation of the WebGPU spec. So a thin TS wrapper exposing WebGPU directly is structurally feasible without pulling in a new graphics stack — mostly plumbing and binding work, and I think there's a real case for shipping it as an opt-in Canvas2D is a bigger lift — it's a stateful context API that overlaps with what Before committing, could you say a bit more about the actual use case you have in mind? A few flavors I'm trying to distinguish between:
And on the Canvas2D side — is there a specific thing you need it for that the existing 2D primitives in The answer changes the design a fair bit — for (1) it has to be strictly spec-faithful, for (3) there's more room to make it ergonomic. |
Beta Was this translation helpful? Give feedback.
-
|
Filed two tickets to track this:
Both shaped as opt-in external native bindings (à la Bloom stays the holistic engine. The two new modules are deliberately "stupid" wrappers — spec-faithful, no perry-flavored extensions, no opinions. The point is that code written against the web platform Just Works, both directions. One bit of cross-cutting design captured in #571: bloom's internal wgpu For Canvas2D's role-as-UI-supplement (your last comment), I put that on the v2 list in #570 — the headless / OffscreenCanvas surface has more immediate value (server-side image generation, text measurement) and zero UI dependency, so it's the cleaner first cut. The on-screen embed can land as a follow-up once the headless API has settled. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I know there is a bloom engine here that can be used to create games, but it would be better if it could support the standardized webgpu/canvas 2d api.
This unlocks the possibility of sharing code with web platforms.
I hope this graphics API can support offscreencanvas or ordinary canvas like the web platform, and can import textures generated from 2D context to webgpu.
The reason for choosing webgpu and 2D context is that they happen to have rust libraries that can be used.
Beta Was this translation helpful? Give feedback.
All reactions