google / google/draco

A Possible Bug in the Texture Coordinates Prediction Implementation

Open
#1,117 1 comment 0 reactions 0 assignees View on GitHub
bug low priority
Dominant language
C++
Stars
7.5k
Forks
1.1k
Avg merge
47m
Merged PRs (30d)
1

Description

I believe that the fallback part of the texture coordinates prediction is not implemented in the way it should be.
In [this file](https://github.com/google/draco/blob/main/src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_predictor.h), 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.