question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GLB Quality Issue with pnquant 8-bit Compressed Textures

See original GitHub issue

@toji FYI, this PR broke model-viewer.

Screen Shot 2020-06-16 at 2 23 12 PM Screen Shot 2020-06-16 at 2 23 25 PM

I’ve fixed it by passing { premultiplyAlpha: 'none' } to createImageBitmap by default: https://github.com/mrdoob/three.js/commit/7e5d14894e6ef57007faf5903d713b85c97801ef

_Originally posted by @mrdoob in https://github.com/mrdoob/three.js/pull/19518#issuecomment-646912920_

I am generating glTF + bin + textures from FBX using Facebook’s FBX2glTF. After that I am compressing textures using pngquant and re-packaging it as a GLB file using gltf-import-export. Now when I try to load the asset on ThreeJS editor, glTF file loads properly – without any quality issues – but its corresponding GLB file is having quality issues.

The same file loads up fine on donmccurdy GLTF viewer (uses r116) and many other platforms except threeJS editor (using r120) and Google model-viewer (using r120).

I am not sure what has happened between these releases because I remember it used to work fine with older threeJS versions. If anyone knows what has changed in between and how can this be resolved, please help out.

Attaching screenshots for reference.

glTF File on ThreeJS Editor

image

GLB File on ThreeJS Editor

image

GLB File on DonMccurdy’s Viewer

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
donmccurdycommented, Sep 18, 2020

Fix coming in https://github.com/mrdoob/three.js/pull/20376, thanks for the report!

0reactions
ShantanuSrivcommented, Sep 17, 2020

I guess we’ll have to check alpha in a different way for some types of .png files. @ShantanuSriv can you share an example .png file that is not working?

Sample 8-bit PNG File image

Read more comments on GitHub >

github_iconTop Results From Across the Web

GLB Not Loading Properly on ThreeJS Editor - Questions
I am generating glTF + bin + textures from FBX using Facebook's FBX2glTF. After that I am compressing textures using pngquant and re-packaging ......
Read more >
KTX Textures get lost on GLB Export - Questions - Babylon.js
Hi, I'm having issues with the GLB Exporter, if KTX2 compressed textures are involved in the model. Open this playground example of a...
Read more >
pngquant 3.0.1 - Docs.rs
pngquant is a PNG compressor that significantly reduces file sizes by converting images to a more efficient 8-bit PNG format with alpha channel...
Read more >
integer overflow - CVE - Search Results
When compressing a crafted PNG file, it encounters an integer overflow. CVE-2020-29361, An issue was discovered in p11-kit 0.21.1 through 0.23.21.
Read more >
Automate your E-Commerce 3D Optimization Pipeline - 3D & AR
The problem is that optimization is inherently downstream from the ... and quality problems related to using a texture resolution that is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found