Thoughts about a WebGL-Next (2016)
floooh.github.io
floooh.github.io
http://floooh.github.io/2016/10/24/altai.html
I think something like this could be used as a minimal wrapper for WebGPU, with WebGL2 and WebGL as fallback paths (shaders will be a problem though).
I've done something similar with Go, it was a library [0] that exposed identical API in 3 situations: desktops, mobile, and browsers. It uses OpenGL 2.1 backend on desktop, OpenGL ES 2.0 on mobile, and WebGL 1.0 in browsers.
It worked really well and results in an extremely cross-platform graphics library. It was also a great way to learn about the few subtle differences between OpenGL ES and WebGL, and understand the kind of challenges they faced when designing the WebGL API.
To my _very_ naive thinking, and if video RAM was plentiful, couldn't things be set up such that the JS runtime _could_ write to the GPU, but to a reserved section of video memory that wasn't directly executable? After being checked by the JS runtime, bytecode could be copied over to another area in video memory to be run. Would something like this work? If so, has this approach been tried by anyone?
I think this is the wrong approach for a 3D API that should be usable by more people than a very small group of highly specialised rendering engineers. Metal is an API that fills that gap very well, it is easy to use and is a modern low-overhead API.
A proper modern 3D web API should be agnostic to the underlying native API (a bit similar to how WebGL runs on top of D3D on Windows, but with much less 'conversion overhead' since most state is compiled into immutable objects).
But simplicity and ease of use should not be guiding the decisions, the emphasis should be on providing a way to run Unity, Unreal, and other engines (new and old) on the Web.
Even if Vulkan is a difficult API to work with, a low level 3d API should be available in a browser. It could be used as a building block to create frameworks and engines that are easy to use.
Even WebGL is "too low level" for most application developers, which is why three.js and other frameworks are popular.
I'm sure the spec can still be changed to be a better fit, though.
Either that, or in addition to WebVulkan you need WebDX12 and WebMetal.
http://lmgtfy.com/?q=vulkan+metal
First result: "MoltenVK is an implementation of Vulkan that runs on Apple's Metal graphics framework on iOS and macOS."
Also a reason, why outside communities like HN, most game developers don't really care about API wars.
I don't think you can really put those aside - that's the whole point of web as a platform - that visiting a link won't let you take over my PC (and that's hard enough as is in practice).
Just use native apps if you want native access.