I think the decision should be taken now to remove the WebGL layer support from the current WebXR draft spec and add in WebGPU layer support.
In the current WebXR spec:
https://immersive-web.github.io/webxr/
there are 146 references to WebGL and 0 to WebGPU. There is a lot of work involved in tightly specifying this layer, and choosing which 3D technology to support by default in the initial spec is very important. The potential for other layers is acknowledged in the current WebXR draft - section 11 starts with:
11. Layers
Note: While this specification only defines the XRWebGLLayer layer, future extensions to the spec are expected to add additional layer types and the image sources that they draw from.
At the moment, the plan seems to be to support WebGL in the initial release and add support for WebGPU sometime in the distant future; what I propose is to reverse this - to support WebGPU now as the initially supported default layer, and if really needed (which might not be the case), to add WebGL in the future.
WebXR should not be considered a standalone spec, but rather as a member of a family of modern specs (graphics, sound, RTC, WebAssembly) that should work really well together and that modern web application developers will likely use together. The early adopter developers likely to quickly create web apps with the new WebXR are also the very ones who will want to be using the new WebGPU, not the legacy WebGL.
Hi @eamon-otuathail,
that's an interesting thought, especially the part about early adopters being likely to use WebXR together with other modern specs. I can speak for myself atleast that this is the case and I am indeed using WebXR together with WebAssembly and WebGL 2.0 for example. I would disagree with WebGPU being a modern spec, rather a "future spec" maybe, as it is not released yet and it's state is quite a bit behind that of this API (likely because WebGPU started later and is a very ambitious project). Also, see Implementation Status of WebGPU.
Until WebGPU is effectively usable, it would hold up the release and implementation of WebXR 1.0 for a long time, as opposed to WebGL 1.0 and even 2.0 being already widely available.
I would therefore be rather concerned if WebGL support were to be dropped from WebXR. As far as I understand there are also no plans to drop it in the future (in favour of WebGPU support), either, but always support it.
WebGPU is likely not meant to replace WebGL, like Vulkan does not replace OpenGL, they both have their place.
Or do you still see WebGL support as unjustified in some way?
Best,
Jonathan
A lot of existing frameworks use WebXR with WebGL already, and I don't think they have WebGPU support yet.
Plus, I don't think WebGPU is quite there yet implementation-wise, whereas WebXR is set to release on multiple browsers in less than a month.
It's not practical to remove WebGL support. WebXR is shortly going to be made available by default in a number of browsers, but (as the other commenters have mentioned) no browser has yet enabled WebGPU by default and I have first hand knowledge that there is still non-trivial work to be done before it reaches a point where it will be reasonable to do so.
That being said, I am incredibly excited for WebGPU's future release, and am incredibly optimistic about the benefits it will be able to provide to GPU accelerated graphics on the web. There's no question in my mind that WebXR _will_ support WebGPU when it has stabilized, just not as the sole rendering mechanism. From what I can see currently the best path to get there is to pursue a more robust layering mechanism that separates the source of the imagery from the method of projection. @Artyom17 has proposed a method for doing so, and I've recently followed up with my own thoughts on the subject.
Since I don't see any effort to remove WebGL integration being widely supported by the working group I'm going to close this issue, but I do highly encourage anyone interested in WebGPU support for WebXR to engage in the discussion in the layers repo.
Most helpful comment
Hi @eamon-otuathail,
that's an interesting thought, especially the part about early adopters being likely to use WebXR together with other modern specs. I can speak for myself atleast that this is the case and I am indeed using WebXR together with WebAssembly and WebGL 2.0 for example. I would disagree with WebGPU being a modern spec, rather a "future spec" maybe, as it is not released yet and it's state is quite a bit behind that of this API (likely because WebGPU started later and is a very ambitious project). Also, see Implementation Status of WebGPU.
Until WebGPU is effectively usable, it would hold up the release and implementation of WebXR 1.0 for a long time, as opposed to WebGL 1.0 and even 2.0 being already widely available.
I would therefore be rather concerned if WebGL support were to be dropped from WebXR. As far as I understand there are also no plans to drop it in the future (in favour of WebGPU support), either, but always support it.
WebGPU is likely not meant to replace WebGL, like Vulkan does not replace OpenGL, they both have their place.
Or do you still see WebGL support as unjustified in some way?
Best,
Jonathan