Bbabo NET

Science & Technology News

WebGL 2.0 is finally supported in all major browsers

WebGL Water demo screenshot by Evan Wallace

The developer consortium Khronos Group announced that WebGL 2.0 technology for rendering interactive 2D and 3D graphics without plug-ins is finally supported in all major browsers (check).

The specification has been supported in Firefox and Chrome since 2017. However, this was not enough for its painless implementation. Support was added to Edge in 2020, with Safari 15 for macOS and iOS being the latest update. This happened after two years of intensive work by Apple WebKit engineers, who chose a non-standard, but very pleasant path for the open source community (more on that below).

Now all developers can in good conscience ignore fallbacks on 1.0, which will greatly simplify the web's graphics ecosystem.

Khronos Group is a non-profit consortium of over 150 developers in the field of 3D graphics, VR/AR, parallel programming, graphics accelerators and machine learning. The consortium creates and promotes graphics standards such as Vulkan, OpenGL, WebGL, SPIR-V, OpenCL, OpenVX, OpenXR, ANARI and glTF.

Introduced in 2017, WebGL 2.0 was a significant step forward in terms of computer graphics capabilities. It provided the OpenGL ES 3.0 feature set. Key new features:

feedback of the transformation via the TransformFeedback object;

nstant rendering;

multiple render targets;

objects of general uniform memory buffers - Uniform Buffer Objects (UBO);

overlap requests;

much broader texture support than the original WebGL 1.0 pipeline.

The new 2.0 specification was supported by Firefox and Chrome from the beginning, but it took a long time to spread to all WebGL developers. For years, developers have needed to provide a fallback to WebGL 1.0 to cover all popular browsers and devices. Now it's not. The rollout of WebGL 2.0 across browsers is complete, and application authors can use it with confidence, says the Khronos Group consortium.

Serious work on implementing WebGL 2.0 in Safari began in June 2019. This has resulted in several pleasant side effects for the open source community. It started with the fact that Apple decided to use the free ANGLE engine. As a result, their engineering team spent countless hours improving the Metal backend.

Safari now works with WebGL on top of Metal on recent iOS and macOS devices. The Apple and Google engineering teams have started working together to bring ANGLE to WebKit. They create a common code base for further development and translation of Chrome to the ANGLE Metal backend too.

WebGL Aquarium Demo, (c) Gregg Tavares, Human Engines

This demo can be synchronized to multiple machines via WebSockets.

Although WebGL 2.0 has achieved widespread support in all major browsers, work on the specification will continue to improve compatibility and consistency.

The Future is WebGPU

Thus, the graphics ecosystem has become much simpler. Further development of graphical web applications in the coming years will provide WebGPU programming interfaces.

The development of the WebGPU API is actively underway in the relevant W3C working group. The last draft came out on January 14, 2022, that is, recently. Now it's a working draft. The technology provides browsers with modern Direct3D 12, Metal and Vulkan computer graphics capabilities.

Full deployment of any specification takes time. WebGL 1.0 was released in March 2011, and support in 80% of browsers came only after 3.5 years. The same is true now. WebGL 2.0 achieved the same 80% in the same amount of time. The journey to WebGL 2.0 and WebGPU will continue even after the WebGPU specification is officially approved.

In the meantime, WebGL continues to evolve. The Khronos Group recently announced the availability of at least one compressed texture format (ETC2 or S3TC) in all browsers, as well as a new multi-draw extension that greatly improves rendering performance by batching geometry. The OES_draw_buffers_indexed functionality allows for advanced transparency techniques that are independent of object order.

Now, in fact, WebGL is the most widespread and accessible 3D graphics platform in the world.

The Khronos Group encourages all developers to move from WebGL 1.0 to WebGL 2.0 and to participate in online activities. There is a WebGL Dev List mailing list and a WebGL Chat at The Matrix (#webgl:mozilla.org).

WebGL 2.0 is finally supported in all major browsers