draco icon indicating copy to clipboard operation
draco copied to clipboard

Texture coordinate value is severely distorted after compression

Open SunnyBily opened this issue 3 years ago • 3 comments

Hello,

I am trying to compress a GLTF file using my program with draco lib v1.5.3.

After compression, the texture coordinate value becomes the same coordinate value. 企业微信截图_16589175841723

That's different with my source data. And it causes that the rendering result was completely black. image

And before compression, the texture can be loaded properly like this: 企业微信截图_16596717441959

The conversion parameters I used: position quantization: 16 tex_coord quantization: 10 normal quantization: 8 SpeedOption 3, 3 MESH_SEQUENTIAL_ENCODING

I use TriangleSoupMeshBuilder to build mesh, and SetAttributeValuesForFace interface to add texCoord to the mesh.

I've tested a lot of models this way and they're all fine except for this one.

Here is glTF model before compression I just mentioned. beforeCompression.zip

Here is glTF model after compression by my program. AfterCompression.zip

SunnyBily avatar Aug 05 '22 04:08 SunnyBily

Is the model processed using draco_transcoder or some other way? The texture coordinate values look a bit suspicious. In most cases UVs are in range between 0-1, seeing -232.xx is rather unexpected

ondys avatar Sep 16 '22 17:09 ondys

Could you check whether these part of your mesh doesn't have UV? Draco tends to give dummy UV for part of the mesh without UV.

ngcthuong avatar Oct 02 '22 19:10 ngcthuong

Possibly related:

https://github.com/donmccurdy/glTF-Transform/issues/936#issuecomment-1536554093

donmccurdy avatar May 05 '23 17:05 donmccurdy