draco icon indicating copy to clipboard operation
draco copied to clipboard

A Possible Bug in the Texture Coordinates Prediction Implementation

Open shunski opened this issue 4 months ago • 1 comments

I believe that the fallback part of the texture coordinates prediction is not implemented in the way it should be. In this file, it seems to me that the line 258:

if (next_data_id < data_id) {

should be:

else if (next_data_id < data_id) {

Otherwise, the fallback prediction at the line 256:

data_offset = prev_data_id * kNumComponents;

will ALWAYS be overwritten by the if-else blocks that follow, and as a consequence, the prediction will fallback to the zero prediction even if it can fallback to the delta coding with previous vertex. This issue would not break meshes at all (as prediction functions could really be anything as long as they are consistent throughout encoding and decoding), but it will certainly reduce the compression efficiency for some meshes.

shunski avatar Aug 23 '25 14:08 shunski

Good catch. Fixing it would require a bitstream change to fix this though which we are not planning to do in a near feature. We will keep track of this and fix it when we are ready to update the bitstream. Thanks

ondys avatar Sep 04 '25 16:09 ondys