KhronosGroup / glTF-Compressor

To store the source code for the glTF-Compressor project
Other
58 stars 6 forks source link

Incorrect thumbnail aspect ratios with KTX #6

Closed echadwick-artist closed 1 year ago

echadwick-artist commented 1 year ago

Hi, I noticed a small problem with KTX thumbnails.

Non-square KTX textures should render their thumbnails with non-square aspect ratios, but they do not.

  1. Download a GLB which contains KTX2 assets inside it, for example https://github.com/KhronosGroup/3D-Formats-Guidelines/blob/main/samples/StainedGlassLamp/StainedGlassLamp-KTX-BasisU-Volume-ETC1S.glb
  2. Go to https://phasmatic3d.github.io/glTF-Sample-Viewer-KTX-demo/
  3. Drag and drop the GLB into the 3d view.
  4. Go to the Texture Compressor tab.
  5. Scroll to the end of the Texture Details list.
  6. Open a new browser window (I'm using Chrome on Windows), and repeat the above except using a GLB with PNG/JPG textures, for example https://github.com/KhronosGroup/3D-Formats-Guidelines/blob/main/samples/StainedGlassLamp/StainedGlassLamp-JPG-PNG-Volume.glb
  7. Compare the two windows side-by-side.

Result: non-square JPG/PNG thumbnails are shown with the correct aspect ratio, while the KTX thumbnails are always square. Non-square KTX textures should render their thumbnails with non-square aspect ratios.

2023-07-17 16_16_20-glTF Sample Viewer with KTX

Thank you!

abasilak commented 1 year ago

The commit https://github.com/phasmatic3d/glTF-Sample-Viewer-KTX/commit/4186b1ae044cf396066c06c2d07fe2d40213abd2 solved this issue.

echadwick-artist commented 1 year ago

Thanks! Does the demo app still need to be updated?

abasilak commented 1 year ago

Yes. We will also have to solve #2 (aspect ratio) before updating it.

echadwick-artist commented 1 year ago

Yay all fixed. Thank you!