BabylonJS / Babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
http://www.babylonjs.com
Apache License 2.0
23.17k stars 3.42k forks source link

Black surfaces for some KHR_texture_basisu textures. #9503

Closed donmccurdy closed 3 years ago

donmccurdy commented 3 years ago

For the attached file using KHR_texture_basisu, textures 1-3 are already power-of-two dimensions. Textures 4-6 are NPOT, and are resized by toktx. The dimensions of the mipmaps generated by toktx are below:

Screen Shot 2020-11-28 at 8 41 28 PM

For some reason, this model is rendering correctly in three.js, but displays black surfaces for textures 4-6 in babylon.js. Because all final textures have power-of-two dimensions, I don't think this is a WebGL compatibility issue. It may be related to textures 4-6 having non-square dimensions? Or something unexpected in the generated KTX2 file?

Further context in https://github.com/donmccurdy/glTF-Transform/issues/144 and https://github.com/KhronosGroup/KTX-Software/issues/345.

Repro

Archive.zip

Screen Shot 2020-11-28 at 8 38 29 PM

Screen Shot 2020-11-28 at 8 38 24 PM

Screenshots

See above.

Desktop (please complete the following information):

sebavan commented 3 years ago

Thanks a lot for your report @donmccurdy :-)

Adding @Popov72 our KTX2 master

Popov72 commented 3 years ago

Thanks for the report, fixed by #9507

donmccurdy commented 3 years ago

Awesome, thank you! :)