Giter Site home page Giter Site logo

gltf-compressor's People

Contributors

abasilak avatar agkar avatar khronoswebservices avatar vineek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gltf-compressor's Issues

Incorrect thumbnail gamma with KTX

  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. Open a new Chrome window, 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
  6. Compare the two windows side-by-side.

Result: some thumbnails are displayed with incorrect gamma.

  • Normal/occlusion/rough/metal textures are overbright (they should be displayed in linear colorspace).
  • Basecolor and emissive seem to be OK.
  • KTX2 with alpha channel seems to be displayed with black, compared to gray for a PNG with alpha.

Screenshots comparing glTF with KTX vs glTF with PNG/JPG:
2023-06-29 17_06_08-glTF Sample Viewer
2023-06-29 17_11_39-AnisotropyBarnLamp gltf - Visual Studio Code

File already Exists Copressed GLTF export

zip-writer.js:142 Uncaught (in promise) Error: File already exists
at ZipWriter.add (zip-writer.js:142:11)
at main.js:758:34
at Array.map ()
at SafeSubscriber._next (main.js:756:50)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:192:16)
at SafeSubscriber.next (Subscriber.js:130:22)
at Subscriber._next (Subscriber.js:76:26)
at Subscriber.next (Subscriber.js:53:18)
at MapSubscriber._next (map.js:41:26)
at Subscriber.next (Subscriber.js:53:18)

Slow to run in Chrome?

Feeding this back from myself and the 3D team at my work, we all find that the compressor runs very slow on the web, is there any plan to do a Windows/Mac/Linux build of this that runs local?

The wait times for compression can feel very long and Chrome on Windows 10/11 can often freeze for a few minutes running it as the only open tab.

I have used similar compressors such as gltfpack: https://github.com/zeux/meshoptimizer/releases and Needle Tools which run much faster natively https://needle.tools/

We are testing with models from the GLTF samples repo such as DamagedHelmet and BarramundiFish so these aren't big test models.

Just wondering if running on the web is what is causing the performance bottlenecks?

Anisotropy support

glTF-Compressor seems to be using an outdated version of glTF Sample Viewer, because anisotropy is not supported here.

  1. Download a GLB which uses KHR_materials_anisotropy, for example https://github.com/KhronosGroup/glTF-Sample-Assets/blob/main/Models/AnisotropyStrengthTest/glTF-Binary/AnisotropyStrengthTest.glb
  2. Go to https://phasmatic3d.github.io/glTF-Sample-Viewer-KTX-demo/
  3. Drag and drop the GLB into the 3d view.

Result: Anisotropy is not being rendered. Also in the Advanced Controls tab KHR_materials_anisotropy is not shown under Disable Extensions.

image

2D compare display issue

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!

Supporting Mipmaps?

Hi!

I noticed that support for embedding mipmaps is currently missing from glTF Compressor. Clients cannot typically generate mipmaps for compressed textures at runtime, so I think that would be an important addition when possible.

Possibly this depends on KhronosGroup/KTX-Software#464?

Suggestion: "revert compression" button

It would be helpful to have a "Revert Compressions" button which would discard new compressions on all selected textures, reverting them to their original formats.

Perhaps this could be added underneath the "Compress Textures" button.

Mockup:
2023-09-22 10_19_46-

Suggestion: larger hotspot for before/after slider

The hotspot for dragging the before/after vertical bar is 2 pixels wide, which makes it difficult to "grab".
before-after-hotsot

Could we widen the hotspot to maybe 10 pixels wide, while keeping the vertical bar the same 2-pixel width?

Incorrect thumbnail aspect ratios with KTX

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.