KhronosGroup / KTX-Software

KTX (Khronos Texture) Library and Tools
Other
861 stars 225 forks source link

Conversion to ktx2 using toktx of a jpg image is resulting into a black ktx2 texture #818

Closed mahfouzhseineweev closed 8 months ago

mahfouzhseineweev commented 9 months ago

I have a jpg texture that I am trying to convert using the KTX-Software into a ktx2 file but when I do so using toktx, the result I am getting is a full black texture.

Here are the details I have:

earthNight

Note that I have used the exact same command options on other textures and they were created with no problem.

Please help me understand and solve the problem I am facing, thank you.

MarkCallow commented 9 months ago

That exact command is working for me in the 4.3.0 beta I am currently preparing and will soon release. Because of the --target_type it might not work in v4.3.0-alpha3 or v4.2.1. v4.0 is now very old. Please try a more recent version of toktx.

Note that the --target_type serves no purpose here. The ETC1S encoder will strip an all-1 alpha channel to avoid doubling the size of the texture. Therefore asking toktx to add an alpha channel just wastes cpu cycles.

Here is an image showing all the mip levels and the lights are clearly visible.

Screenshot 2023-12-15 at 17 08 38
mahfouzhseineweev commented 9 months ago

@MarkCallow I tried without the --target_type but it didn't work. So it seems like the v4.3.0 beta has the fix for it. I currently have the v4.3.0-alpha3 installed.

When is the v4.3.0 beta expected to be release ?

MarkCallow commented 9 months ago

When is the v4.3.0 beta expected to be release ?

Within a few days. I can't give a precise time frame because I am dependent on third parties for some things.

MarkCallow commented 8 months ago

4.3.0-beta1 has been released. I can't reproduce this problem in it. If it still happens for you, please reopen.

mahfouzhseineweev commented 8 months ago

I still have the same problem, installed the 4.3.0-beta1 version from here

I am suspecting this to be a versioning problem somewhere, I am running the software on the following specifications:

@MarkCallow Please let me know if there are any additional details that I have to share with you so I can help to reproduce the problem

MarkCallow commented 8 months ago

Please provide the KTX v2 file you have created.

I am running Ventura 13.6.3, cmake 3.26.3 and Xcode 15.1 though I was running XCode 14 when I was testing this before.

mahfouzhseineweev commented 8 months ago

@MarkCallow Here is the last one I created, if possible please to send me the one you created that has no problem. I also suggest that you try the conversion with the Version 4.3.0-alpha3 of the software which might narrow down the possibilities of the reasons causing this problem

nightTexture2.ktx2.zip

MarkCallow commented 8 months ago

The texture is fine.

Screenshot 2024-01-11 at 18 36 50

There may be an issue with your application. This is an ETC1S/BasisLZ texture so possible you are not transcoding it or are transcoding it to a format not supported on your hardware. It is is not one of these then the texture loaded into WebGL may be incomplete. Look at the spec. for all the reasons a texture can be incomplete which includes, in some cases, being non power-of-two and exceeding the maximum texture size supported by the implementation. This texture is 13,500 x 6,750 pixels.