Skip to content
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

Texture Error loading in WebGPU loader gltf compressed example #28035

Closed
Thakisis opened this issue Mar 31, 2024 · 9 comments
Closed

Texture Error loading in WebGPU loader gltf compressed example #28035

Thakisis opened this issue Mar 31, 2024 · 9 comments
Milestone

Comments

@Thakisis
Copy link

Description

Work fine in firefox but throw error in chrome/edge

Reproduction steps

Code

// code goes here

Live example

Screenshots

ErrorCompressed

Version

163

Device

Desktop

Browser

Chrome, Edge

OS

Windows

@RenaudRohlinger
Copy link
Collaborator

Can't reproduce on MacOS. Could this be related to #28021?

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 1, 2024

The OP uses r163 (see URL) and #28021 is only on the dev branch.

I can't reproduce on macOS as well.

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 1, 2024

The numeric value 33776 corresponds to ext.COMPRESSED_RGB_S3TC_DXT1_EXT so the texture is using RGB_S3TC_DXT1_Format.

@Thakisis Can you make a test with Chrome Canary and see if the issue persists?

@Thakisis
Copy link
Author

Thakisis commented Apr 1, 2024

sure i will try in other two computers and tell you if that error persist
Canary

@Thakisis
Copy link
Author

Thakisis commented Apr 1, 2024

Tried different computers. 2 laptop and other desktop and same problem.

@GitHubDragonFly
Copy link
Contributor

If it helps with this issue, I use a Windows 10 laptop and this example works in both Chrome and Edge.

WebGPU GLTF Compressed - Chrome

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 1, 2024

This issue is actually a duplicate of #26124.

On macOS (at least on my system) KTX2Loader produces an ETC2 texture (RGB_ETC2_Format) which is properly supported in WebGPURenderer. However, on Windows I can confirm the loader produces RGB_S3TC_DXT1_Format which is an unsupported format in WebGPU. It has to be a RGBA format meaning RGBA_S3TC_DXT1_Format.

@donmccurdy Can we tell KTX2Loader somehow not to target RGB_S3TC_DXT1_Format in context of WebGPU? Currently WebGPURenderer supports RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format and RGBA_S3TC_DXT5_Format all with optional SRGBColorSpace. Relevant code section:

case RGBA_S3TC_DXT1_Format:
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.BC1RGBAUnormSRGB : GPUTextureFormat.BC1RGBAUnorm;
break;
case RGBA_S3TC_DXT3_Format:
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.BC2RGBAUnormSRGB : GPUTextureFormat.BC2RGBAUnorm;
break;
case RGBA_S3TC_DXT5_Format:
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.BC3RGBAUnormSRGB : GPUTextureFormat.BC3RGBAUnorm;
break;

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 1, 2024

Closing in favor of #26124.

@Mugen87 Mugen87 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2024
@donmccurdy
Copy link
Collaborator

donmccurdy commented Apr 1, 2024

Can we tell KTX2Loader somehow not to target RGB_S3TC_DXT1_Format in context of WebGPU?

I think we could do that unconditionally for both WebGL and WebGPU. BC1 has a 1-bit alpha channel, which probably is there regardless of whether we specify RGB or RGBA.

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