donmccurdy/glTF-Transform

Incorrect vertex color dequantization, context-dependent

timothyallan opened this issue · 3 comments

I have a clients model which goes through my gltf-transform v3.10.0 + node 18.19 optimizing process, which is basically the same as the R3F transform here https://github.com/pmndrs/gltfjsx/blob/master/src/utils/transform.js

As soon as reorder({ encoder: MeshoptEncoder }) is introduced (with either 'size' or 'performance' options), this happens:

Screenshot 2024-02-17 at 12 27 26 PM
Screenshot 2024-02-17 at 12 22 15 PM

Loading it into the online viewer, it appears fine, but shows 5 errors relating to a material clearcoatFactor from the blender export, but nothing super out of the ordinary.
Screenshot 2024-02-17 at 12 53 40 PM

I've run many dozens of different models through this pipeline and it's the first time this has happened. Any suggestions or ideas?
I can provide a private link to the model if required.

@timothyallan is it possible that there's alpha blending enabled on this material, where it should be opaque? That's my first guess, and reorder() could certainly cause unexpected issues in such a model. But if not, I may need to take a look at the model. My email address can be found on my GitHub profile or website (https://www.donmccurdy.com/).

Thanks @timothyallan! I've fixed the issue and published to v4.0.0-alpha.7. Installing from the @next tag will pull in the v4 alpha release:

npm install --save @gltf-transform/core@next @gltf-transform/extensions@next @gltf-transform/functions@next

Just tested it, and it works great now. Thanks for your assist on this @donmccurdy!