Skip to content

Conversation

@donmccurdy
Copy link
Collaborator

Changes in #25375 allowed textures with non-multiple-of-four dimensions to display if the texture had no mipmaps, but caused a regression in mipmapped textures with non-power-of-two dimensions. As proposed in #25908, this PR aims to do both, but we cannot support non-multiple-of-four mipmapped textures in some texture formats and WebGL backends.

A warning will now be logged when loading a non-multiple-of-four texture with ETC1S or UASTC compression. Multiple-of-four dimensions are mandatory for KTX2 files used in glTF models, but the KTX2 format has no such restriction.

@mrdoob mrdoob added this to the r153 milestone May 20, 2023
@mrdoob mrdoob merged commit 2b09a2c into mrdoob:dev May 20, 2023
@donmccurdy donmccurdy deleted the hotfix/ktx2loader-mult-of-4 branch May 20, 2023 13:24
@donmccurdy
Copy link
Collaborator Author

donmccurdy commented May 20, 2023

Collection of test cases attached below:

KTX2 Variants.zip

To my understanding, the non_mul4_mips.ktx2 sample simply will not work on some devices with WebGL, without decoding to uncompressed RGBA8. We should strongly encourage users of KTX2 textures to choose multiple-of-four dimensions. Consider power-of-two dimensions, as well.

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.

KTX2Loader: Offset overflows texture dimensions

2 participants