TextureUtilsGPU.js - possible code changes

Since this is WebGPU related, not really sure of how accurate these statements will be since I do make lots of changes on my end and it could just be my code, maybe test them yourself:

  • Currently, if a renderer is to be provided to the decompress function then the variable _renderer should remain undefined and its check to null in order to dispose of it might throw an error
    • The _renderer does not appear to have any functionality so it could probably be removed
  • Textures in the official coffeemat.glb example have odd scale and offset and the decompress function might not properly decompress them
  • I did see a few warnings about non-power-of-two textures not providing correct buffer size, not really sure if this is three.js related and whether the TextureUtilsGPU.js file might need any code changes for that

No specific example to provide as a codepen.

This is more of an FYI but feel free to reply and correct any of these statements.

The scale and offset affects the UVs, but shouldn’t be relevant to decompressing the texture – I think that part is fine. The UV transforms are related to the quantization used in Meshopt compression.

I did see a few warnings about non-power-of-two textures not providing correct buffer size…

If it’s three.js reporting the warnings, that might be left over from WebGL 1 support? In general WebGL 2 should be more flexible.

1 Like

This all sounds good to me.

Hopefully nobody else reports it but in case if they do then can refer to this topic.