BinomialLLC/crunch

non-square textures missing 1x1 mip level, which WebGL needs to render

bunnybones1 opened this issue · 1 comments

I was unable to get a non-square texture with mipmaps to render in WebGL unless I squared it myself beforehand.
The non-square texture coming out of crunch looks healthy to me.
Screen Shot 2021-11-20 at 12 31 02 PM

The idea came from someone who had this issue with ETC textures, and their solution seems to work (for android, where ETC is most common):
google/etc2comp#31

PVRTC ofcourse strictly requires square textures, so the bug is simply not possible there.

After some testing, I made a funny discovery:
If you make the image wider, instead of taller, it generates all the mip levels up to 1x1, and it works
Somewhere in the code, it must be using the width as the basis for the mip level count.
This does atleast open up a workaround: we can rotate all our textures 90 degrees before compressing.