Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Aug 23, 2025

Fixed #31690.

Description

As mentioned in #31690 (comment), the feature detection in KTX2Loader for WebGPURenderer is indeed incorrect.

The spec has slightly changed and the PR updates the feature detection to reflect that:

  • texture-compression-bc now includes the "S3TC", "RGTC", and "BPTC" formats.
  • texture-compression-bptc has been removed (included in texture-compression-bc).
  • texture-compression-etc1 has been removed (included in texture-compression-etc2).

BC6HRGBFloat: 'bc6h-rgb-float',
BC7RGBAUnorm: 'bc7-rgba-unorm',
BC7RGBAUnormSRGB: 'bc7-rgba-srgb',
BC7RGBAUnormSRGB: 'bc7-rgba-unorm-srgb',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BC7RGBAUnormSRGB had a wrong value.

@github-actions
Copy link

github-actions bot commented Aug 23, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.91
79.1
338.91
79.1
+0 B
+0 B
WebGPU 578.73
159.37
578.78
159.39
+50 B
+20 B
WebGPU Nodes 577.34
159.13
577.38
159.14
+50 B
+18 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 470.7
113.91
470.7
113.91
+0 B
+0 B
WebGPU 649.28
175.4
649.33
175.42
+50 B
+17 B
WebGPU Nodes 603.38
164.55
603.43
164.57
+50 B
+17 B

break;

case RGB_ETC2_Format:
case RGB_ETC1_Format:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since ETC2 is backward compatible with ETC1, we can use the same approach like in WebGLRenderer and handle ETC1 as ETC2:

if ( p === RGB_ETC1_Format || p === RGB_ETC2_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;

@Mugen87 Mugen87 added this to the r180 milestone Aug 23, 2025
@Mugen87 Mugen87 merged commit c0625c4 into mrdoob:dev Aug 23, 2025
9 checks passed
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.

WebGPURenderer: Missing compressed texture formats

1 participant