oguzhancevik / obj2gltf

OBJ to glTF converter for Java
9 stars 4 forks source link

Unsupported textures format .dds #3

Open Sevelantis opened 2 years ago

Sevelantis commented 2 years ago

Hello,

thank you for creating such tool. We know the DDS graphic file format, right?

Your tests with PNG textures format work as expected. Although, if you try using DDS textures, the output GLTF will unfortunately remain corrupted. By corrupted I mean that the input DDS textures won't be loaded into the output GLTF. Are you able to help with such issue? Please come and let's take a look.

Reproduction steps:

  1. I cloned your repository into my Intellij and checked if the output is really a 3D Leonardo Di Caprio (PNG) - it was all ok.
  2. I converted your test PNG to DDS file format using an online converter to check if your converter supports DDS and replaced the PNG with the DDS in-place (appropriately change the MTL file, so it targets DDS).
  3. After running a test I dragged the output DDS file onto the online gltf viewer. After I dropped the file on the website, an error popped up with the following info: "Missing texture: 4723962c............".
  4. The version of the base library that you should be using in your project is now 2.0.3 and no longer 2.0.1. The javagl author Marco pushed a 2.0.3 version to Maven repo. In 2.0.1 version there was an issue that had been discarding all DDS files - please update your pom.xml file (dependecy jgltf-model 2.0.3).
  5. After searching the Internet, as far as I understand, it turned out that GLTF format authors have their reasons behind not to support DDS, BUT there are people in need like us. Check out the example extension: https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/MSFT_texture_dds/README.md but I am struggling with implementing this into your code, since it's not clear to me how am I able to implement it. Maybe I should add those JSON lines into every single DDS file, or maybe to the very top of the output GLTF file? Maybe somehow set the flags? How? And maybe you would be able to help..
  6. Are you able to take up the topic or support? Ofc I can provide more details and answer questions.

Please let me know if you are capable of putting your hands on this topic, or if you don't please let me know, so I can try figuring out another solution for my issue.

Thank you very much in advance, this is really important to me and might improve your project.

Best regards 🚀

Sevelantis commented 2 years ago

@oguzhancevik