callstack / callstack/react-native-draco

GetAttributeDataArrayForAllPoints: non-float attributes have no conversion or mapping fallback

Ouverte
#5 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C++
Étoiles
10
Forks
0
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

## Environment

@callstack/react-native-draco 0.3.0
three's GLTFLoader, RN 0.86, new architecture, iOS

## Description

`cpp/draco-helpers.h` has two extraction paths that behave differently:

- `GetAttributeFloatArrayForAllPoints` (float requests) walks `mapped_index` and falls back to `pa.ConvertValue()` for non-float source data — it handles quantization and non-identity mapping.
- `GetAttributeDataArrayForAllPointsHelper` (every non-float typed request) only succeeds when `pa.data_type() == type` **and** `pa.is_mapping_identity()` — a direct `memcpy`. Any type mismatch or non-identity mapping returns `false` and decode fails. No `ConvertValue` fallback like Draco's Emscripten wrapper.

So Float32 POSITION/NORMAL/TEXCOORD works, but skinned meshes don't: JOINTS_0 is Uint8/Uint16 and WEIGHTS_0 is often quantized, so GLTFLoader requests typed arrays the helper refuses.

Minor: the `outSize` arguments are byte lengths (the helper asserts `num * components * sizeof(T) == out_size`); the README examples read like element counts.

Suggested fix: give the typed path the same `ConvertValue`-based extraction and non-identity mapping support the float path already has. Happy to send a PR.

## Reproducible Demo

Load any Draco-compressed skinned glTF (JOINTS_0 stored as Uint8) through three's GLTFLoader wired to this module. Static meshes decode; the skinned mesh errors on attribute extraction, because `GetAttributeDataArrayForAllPointsHelper` returns `false` unless the stored type and mapping match exactly.

> Transparency note: this issue was drafted with AI assistance. I'm a human, I've personally verified the behavior in the source, and I'm happy to answer any questions or concerns directly. Thanks for the library.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start in cpp/draco-helpers.h by comparing GetAttributeDataArrayForAllPointsHelper with GetAttributeFloatArrayForAllPoints, then reproduce the failure using a Draco-compressed skinned glTF with Uint8 JOINTS_0. Done means typed extraction supports conversion and non-identity mapping instead of returning false on mismatches; also check whether the README examples should describe outSize as bytes.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
cpp, react-native
Domaine
computer-graphics, mobile-dev
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Clairement spécifiée
Accessibilité débutants
68/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.