Ktx2 texture displayed black on android phone

ktx2 texture is displayed black on android phone but everything is displayed fine on desktop.
How to fix it?
https://www.babylonjs-playground.com/#WP9WDU#137

ping @bghgary

Seems like a bug. I can repro on my phone also. Can you file an issue on GitHub?

unfortunately I can not

You realize that we are doing the work and you can use it for free right?

I believe asking you to help by creating the issue is not an expensive ask

I would love to help you, but I don’t know how, I’m not a programmer

Basically you could copy the description and PG link from your first post and then add a little more info about the device, browser, etc. (it will tell you what info is needed). That would help them track and fix it for us. :slight_smile:

1 Like

I added

2 Likes

It looks like this texture is too big for mobile devices. The texture has dimensions of 16384x8192. For mobile, it is probably better to stay below 2K.

2 Likes

Yes, the problem was in the resolution of the file.

I tested several resolution options:
pano_4x2k.ktx2 works well
pano_8x4k.ktx2 black screen
pano_16x8k.ktx2 black screen

but it works in jpg format
pano_16x8k.jpg works well
pano_8x4k.jpg works well

Due to the large size and resolution of jpg files, I thought about compressing, but it turned out that this does not work for high resolutions.
I’m trying to make a 360 panorama viewer and photo resolution below 8k gives not very good quality.

pano_4x2k.ktx2:

pano_8x4k.ktx2:

pano_8x4k.jpg:

pano_16x8k.jpg:

1 Like

Is there a big visual difference on mobiles between 8K and 2K textures?

What kind of compression are you using for ktx2? ETC1S or UASTC?

windows command line:
toktx --encode uastc --uastc_quality 1 --uastc_rdo_l 1 --zcmp 1

yes, the difference is not very noticeable on the phone, but if you zoom in, you can see the low quality of the texture
I just wanted to make the highest possible quality.

Speaking of “possible” quality one needs to consider that about 70% of user mobiles will have problems with textures more than 2K.
To have even better quality than JPG (which is lossy format) you may try to use PNG (which will be even much bigger in size). Anyway, if you have the original texture file, it is better to convert to KTX from lossless format than from lossy JPG.

2 Likes