Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Apr 30, 2023

Related issue: -

Description

This PR deprecates WebGL 1 supports in three.js. That means the renderer logs now a warning when a WebGL 1 rendering context is detected. That could happen when WebGL1Renderer is used, a custom WebGL 1 rendering context is passed to the renderer's constructor or WebGLRenderer is unable to create a WebGL 2 rendering context and falls back to WebGL 1.

The warning states that in ten releases (r163) WebGL 1 support will be removed. three.js will then require WebGL 2.

Hardware support for WebGL 2 is already very decent. However, I think we should announce the WebGL 1 removal and give users enough time to prepare/react since certain projects still rely on WebGL 1.

Removing WebGL 1 support will allow us to completely delete certain code paths in the renderer which will simplify the code and make it easier to support more WebGL 2 specific features.

@Mugen87 Mugen87 marked this pull request as ready for review April 30, 2023 08:17
@github-actions
Copy link

github-actions bot commented Apr 30, 2023

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
635.5 kB (157.6 kB) 635.7 kB (157.6 kB) +142 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
426.2 kB (103.4 kB) 426.4 kB (103.4 kB) +142 B

@LeviPesin
Copy link
Contributor

The warning states that in ten releases (r163)

I thought it was 11 releases? I.e. if something was deprecated in e.g. r153, it stays there until r163 and is removed only in r164.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented May 1, 2023

I think the text is okay as it is.

@mrdoob mrdoob added this to the r153 milestone May 2, 2023
@mrdoob
Copy link
Owner

mrdoob commented May 2, 2023

How about this?

THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented May 2, 2023

Sounds good! Updated!

@mrdoob mrdoob merged commit bfc9470 into mrdoob:dev May 4, 2023
@Pinpickle
Copy link

@Mugen87 is there a recommended pathway for people who want to support WebGL for the forseeable future?

WebGL 2 support only landed in the last Safari version at the time of writing (15. 16 is the latest), less than 2 years ago. Caniuse reports 94.4% support.

How far away is r163? If a version is roughly every month, does that mean we have until early 2024 to hope our users get more modern devices?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented May 30, 2023

How far away is r163?

February 2024. If you have to support older devices you have to stick to r162.

Supporting WebGL 1, WebGL 2 and WebGPU at the same is going to be more and more challenging. We have to make compromises by removing features so we can focus on more important, future-proof topics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants