KhronosGroup / glTF-Compressor

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

2D compare display issue #2

Closed echadwick-artist closed 1 year ago

echadwick-artist commented 1 year ago

Three issues with the 2d comparison view of a compressed texture:

  1. Large 2D view is vertically flipped compared to the texture thumbnail.
  2. Large 2D view is much darker than the texture thumbnail. This seems to apply to BaseColor but not to Normal nor to ORM.
  3. Large 2D view has incorrect aspect ratio for displaying the texture.

2023-06-23 10_47_07-Window

2023-06-23 10_54_45-Window

Thanks!

abasilak commented 1 year ago

The commit https://github.com/phasmatic3d/glTF-Sample-Viewer-KTX/commit/20ccd6c4b41ec2dca3461122feb63fd9433a8873 solved both 1 & 2 issues.

echadwick-artist commented 1 year ago

Thanks, 1 & 2 look great!

re 3: Ideally the texture would maintain its aspect ratio at all times. Otherwise it's difficult to judge the texture. It should work similar to how a web browser displays a texture file on its own.

If the canvas was taller than the texture, then the texture could be scaled to fill the width of the canvas, and be aligned with the top, with the remainder filled with black. Here's a mockup:

2023-07-17 12_12_29-glTF Sample Viewer with KTX

When the user zooms the 2D view, the pixels would remain square. So the texture would eventually fill the canvas, similar to this mockup:

2023-07-17 12_12_29-glTF Sample Viewer with KTX ZOOM

It would also need to respect the aspect ratio for non-square textures, like those in the StainedGlassLamp sample asset. Here's a mockup of how that could look:

2023-07-17 17_33_44-glTF Sample Viewer with KTX

Thank you for all your efforts. This tool is amazing!

abasilak commented 1 year ago

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

echadwick-artist commented 1 year ago

OK thank you. It's correct for square textures. However now the non-square textures are squished into a square aspect ratio. Comparisons should respect the texture's aspect ratio, if possible.

An example of the problem: 2023-08-03 08_15_17-glTF Sample Viewer with KTX