engine icon indicating copy to clipboard operation
engine copied to clipboard

Remove WebGL1 support

Open mvaligursky opened this issue 2 years ago • 6 comments

As WebGL2 support is almost on all devices (that can run PlayCanvas content): https://web3dsurvey.com/webgl2, it's time to consider removal of WebGL1 support.

There are two stages to this:

  • add a deprecated warning
  • remove the actual support in some future release

mvaligursky avatar Dec 12 '23 13:12 mvaligursky

Because why not: https://twitter.com/willeastcott/status/1734574645871771931

willeastcott avatar Dec 12 '23 14:12 willeastcott

The time has come! cheerful noises in the background

LeXXik avatar Dec 12 '23 15:12 LeXXik

In recent year, the only cases of WebGL 1 I've seen in production is a combination of old hardware and outdated software. The performance of basic content on these devices is really bad, and would require application developer to reduce the quality of the app drastically.

There are various platforms with their stats, biased based on the audience (gaming websites, caniuse, etc).

I believe it is time to go for WebGL 1.

What would a major benefits would be for the engine by removing WebGL1? e.g. Transform Feedback (does WebGPU have alternative, Compute Shaders?), download size reduction, stability, some GLSL features, what else?

Maksims avatar Dec 12 '23 18:12 Maksims

What would a major benefits would be for the engine by removing WebGL1

We could use Uniform buffers on WebGL2 (to match WebGPU). We could add it now, but we'd have two systems.

mvaligursky avatar Jan 19 '24 15:01 mvaligursky

related: https://github.com/playcanvas/engine/pull/5957

mvaligursky avatar Jan 19 '24 15:01 mvaligursky

As mentioned as a response to the above tweet as well, Poki is still seeing around 5% of it's users using WebGL1: https://developers.poki.com/player-device-report/

erikdubbelboer avatar Jan 20 '24 08:01 erikdubbelboer

Looks like Three.js is dropping WebGL1 support in their next release: https://github.com/mrdoob/three.js/pull/27836

liamdon avatar Mar 01 '24 07:03 liamdon

Yep, the timing is ticking here as well .. I suspect we won't have it for too long either.

mvaligursky avatar Mar 01 '24 08:03 mvaligursky

Looks like Three.js is dropping WebGL1 support in their next release: mrdoob/three.js#27836

Bear in mind that updating three.js version in your project is optional, while with PlayCanvas Editor it will be enforced. This makes significant difference.

Maksims avatar Mar 01 '24 13:03 Maksims

The plan to phase out WebGL1 support from the PlayCanvas engine is following:

  • Removal from Engine: We'll eliminate WebGL1 support from the engine. Existing engine-only users can choose to use any engine version that still supports WebGL1.
  • Editor Compatibility: We'll ensure that the Editor remains compatible in the long term with the final engine version supporting WebGL1. Users who rely on WebGL1 will need to remain on this version. While no new features will be released for this engine version, critical bug fixes can still be backported.

mvaligursky avatar Apr 26 '24 08:04 mvaligursky

Calling this done. RIP WebGL1.

mvaligursky avatar May 03 '24 13:05 mvaligursky

Wandering how many KB (%) this shaved of engine. And also in relative measure how much easier is rendering implementation now?

Maksims avatar May 03 '24 17:05 Maksims

@Maksims I would be very surprised if it was >5KB (compressed). It's definitely more interesting from an architectural simplicity point of view.

willeastcott avatar May 05 '24 10:05 willeastcott

Yep the size is not that important. But I can implement uniform buffers / refactor materials across the board. This can be a large win. And many other things.

mvaligursky avatar May 07 '24 07:05 mvaligursky