-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGLTextures: Use gl.texStorage2D()
with compressed textures.
#22928
Conversation
Merging for further testing. |
Thanks! |
@Mugen87 I'm seeing a problem introduced by this PR when testing our webgl / loader / texture / ktx2 example in Safari: In Safari we select ETC1 as the transcode target. In Chrome and Firefox ETC1 is not supported on my device so we select DXT instead, and the problem doesn't occur. None of these browsers are exposing as many compressed formats as they should, and hopefully that will be improved in upcoming browser updates (see issues below). But the browser support is probably a moot point for now – we currently support devices that can only handle ETC1, and dropping that support is not something we should do by accident.
|
Does this selection depend on the type of the WebGL rendering context? Would it be possible to select a different texture compression format when Safari supports WebGL 2? So when using |
It's based on the available WebGL extensions. At least on my device those are consistent between WebGL 1 and WebGL 2:
I haven't tested this myself, but once ANGLE/Metal is enabled the device should be able to support the following in any of the browsers above:
We can do that. If KTX2Loader avoids ETC1 whenever
Probably not necessary, I'm not sure what kind of device would (1) support WebGL 2, and (2) not support more compressed formats than ETC1. See platform support table. Even then, I guess a user could choose to keep using WebGL 2 and transcode the texture into uncompressed RGBA data. |
I would say yes. Since we rely on |
I guess instead of:
it would be: etc1Supported: renderer.capabilities.isWebGL2 === false && renderer.extensions.has( 'WEBGL_compressed_texture_etc1' ), |
Sounds good! Opened #22982. |
Related issue: see #22790 (comment) and #21874
Description
Introduces the usage of
gl.texStorage2D()
with compressed textures.