Problem when migrating from BASIS to KTX2

Hello hope everyone is well.
I am trying to migrate from r122 to r145 so i am changing all basis files to ktx2 files.
I used the toktx to convert from png to ktx2 files like below;
toktx --2d --genmipmap --target_type RGBA --t2 --encode etc1s --clevel 5 --qlevel 255 image.ktx2 image.png;

Previous Result With BASIS

New Result With KTX2

It looks like all the textures become so dark. Textures are mapped correctly but it looks like normalmaps are not and i couldnt figure out why. May i have some help about this?


Try adding --assign_oetf srgb (recommended for color textures) or --assign_oetf linear flags, see if either fixes the issue? These are equivalent to setting texture.encoding = THREE.sRGBEncoding or THREE.LinearEncoding after loading.

Adding “–assign_oetf linear” flag resolved my issue. Thank you very much for the tip.

1 Like

If you’re happy with the results then that’s fine! But if only for future readers — color textures should be using --assign_oetf srgb, and then combined with renderer.outputEncoding = sRGBEncoding your final results will be correct. The reasons for this are explained in the color management section of the documentation.

When i apply --assign_oetf srgb and set renderer.outputEncoding = sRGBEncoding, scene became so shiny so i think i will go on with the linear one now.
I removed the mipmap option and it is even better, actually i dont see too much quality difference between the old basis and the new ktx2 format when i use the top level quality. I shared two images below

Old BASIS Format;

New KTX2 Format

Thanks for the quick help it saved me from a lot of hours!