Graphics Roadmap
martinfouilleul opened this issue · 1 comments
-
On Windows:
- Abandon OpenGL, implement canvas backend on D3D (see #6 for the many reasons using OpenGL for the canvas backend was a "mistake").
- This will also fix the transparent "child windows" hack. It turns out Windows is not very good at windows. For instance, it can not have alpha blended child windows. Our current horrible hack to emulate transparent, compositable surfaces for different graphics APIs is to have transparent top-level windows that we move around as the main window moves (yeah, I know). Ditching OpenGL in favor of D3D means that now both our canvas backend and our ANGLE backend (itself backed by D3D) can more easily share resources. So we can have each surface draw to its own texture, and do the final compositing ourselves.
-
Frame pacing. We do not yet have a compelling story for how frame pacing is handled, made consistent across platforms, and what degree of control users have. Not having to deal with OpenGL driver quirks will certainly simplify that part too. We might want to expose a few options, like the max number of buffered frames, the target frame rate / swap interval, or allow opting out of a fixed frame rate entirely (eg for UI applications who might want to only redraw when something moves)
-
Farther future: Evaluate WebGPU. We're leaving that aside for now because it still seems like a moving target and we don't really have enough information available to properly evaluate it (whereas there's plenty of resources about D3D and it is a stable/consistent API). But we'll probably want to move from WebGL to WebGPU for app-side 3D surfaces. At this point, is might become interesting to have a WebGPU backend for the canvas surface, which would mean we'd only have to deal with one API across surfaces and across platforms.
We finally opted to use WebGPU as the vector renderer backend on both platforms, which was implemented in PR #61
Frame pacing still need some work to make it good and consistent across platforms, but I'll move it to its own issue.