Skip to content

Conversation

@castano
Copy link
Contributor

@castano castano commented Nov 18, 2025

This PR adds support for EAC format as discussed in: #31695

Support for EAC formats required the following changes:

  • Added new constants for the EAC formats with the corresponding GL enum values. I've added support for both signed and unsigned variants.
  • Since the format constants match the GL enums, the KTXLoader does not need any changes.
  • The KTX2Loader is updated to handle the EAC Vulkan formats and translate them to the corresponding GL formats used by three.js internally.
  • Added handling for the new formats where necessary. In particular, enable normal rg packing in NormalMapNode when the format is EAC_RG. Let me know if other parts of the code would need to be aware of these new formats.

In the future it may also be interesting to enable the use of SNORM variants as normal maps. This requires changes to the NormalMapNode to avoid unpacking from UNORM to SNORM. However, the use of SNORM textures is fairly rare, so this will be proposed as a separate PR.

This contribution is funded by Ludicon

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 356.57
86.51
356.97
86.61
+400 B
+100 B
WebGPU 616.86
173.17
617.35
173.31
+498 B
+139 B
WebGPU Nodes 615.46
172.92
615.96
173.06
+498 B
+136 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 488.44
121.33
488.7
121.39
+268 B
+59 B
WebGPU 689.09
189.08
689.46
189.19
+368 B
+110 B
WebGPU Nodes 630.5
172.27
630.87
172.37
+368 B
+99 B

@castano castano marked this pull request as draft November 19, 2025 00:18
@castano castano marked this pull request as ready for review November 19, 2025 00:46
@mrdoob mrdoob added this to the r182 milestone Nov 19, 2025
@Mugen87 Mugen87 changed the title Add support for EAC texture formats. Renderers: Add support for EAC texture formats. Nov 20, 2025
@Mugen87 Mugen87 merged commit ab2018c into mrdoob:dev Nov 20, 2025
10 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.

3 participants