Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertex attribute with UNSIGNED_INT (5125) componentType is not caught by the validator #154

Closed
lilleyse opened this issue Dec 8, 2020 · 3 comments · Fixed by #158
Closed
Labels

Comments

@lilleyse
Copy link

lilleyse commented Dec 8, 2020

We received a model that has a vertex attribute with the UNSIGNED_INT (5125) componentType which isn't isn't valid according to the glTF spec but passes the validator. The model does not have any extensions.

"gltf_detailedDescription": "The datatype of components in the attribute. All valid values correspond to WebGL enums. The corresponding typed arrays are Int8Array, Uint8Array, Int16Array, Uint16Array, Uint32Array, and Float32Array, respectively. 5125 (UNSIGNED_INT) is only allowed when the accessor contains indices, i.e., the accessor is only referenced by primitive.indices.",

I'm still waiting to see if we can share the model but in the meantime here are some snippets from the glTF.

{
  "bufferView":7,
  "componentType":5125,
  "count":2145,
  "type":"SCALAR",
  "min":[4],
  "max":[4]
}
"primitives": [
  {
    "attributes": {
      "_MaxHandle": 7,
      "NORMAL": 6,
      "_fbx_rotation": 4,
      "TEXCOORD_0": 5,
      "_fbx_scale": 3,
      "_fbx_translation": 2,
      "POSITION": 1
    },
    "indices": 0,
    "mode": 4,
    "material": 0
  }
]

_MaxHandle points to the accessor above.

CC CesiumGS/cesium#9270

@lilleyse
Copy link
Author

lilleyse commented Dec 8, 2020

We received permission to share the model: TownHall.glb.zip

@mikedh
Copy link

mikedh commented Jul 27, 2022

Hey, quick question on this and apologies if it's a duplicate:

Does this mean all custom integer vertex properties have to use a 16 bit signed int? How does this validator know that the arbitrary vertex property isn't referencing indices? The error message is Mesh attributes cannot use UNSIGNED_INT component type, which is a bit of a different statement than my interpretation of that spec paragraph: Mesh attributes using UNSIGNED_INT must reference indices.

@lexaknyazev
Copy link
Member

The spec says "unsigned int" in OpenGL-speak, i.e., meaning uint32. All other integer types (signed and unsigned, 8- and 16-bit, including normalized variants) are fine for custom attributes.

clrpackages pushed a commit to clearlinux-pkgs/pypi-trimesh that referenced this issue Aug 9, 2022
…sion 3.13.0

Gleb (11):
      added byteStride support
      corrected code
      fix tests
      fix tests
      fix tests
      fixed
      fixed tests
      fixed tests
      fixed tests
      fixed tests
      rollback some code

Glenn Kerbiriou (25):
      [NRICP] Add multi point set plane fit and test lines
      [NRICP] Added non rigid registration from Amberg et al. 2007
      [NRICP] Added tests for nricp
      [NRICP] Added an example for nricp using models from trimesh/examples
      [NRICP] Update some comments
      [NRCIP] Fix bug in nricp with point cloud target shape and return_records=True
      Add "query_from_points" and "query_from_mesh" functions in trimesh.proximity. Added a dataclass "NearestQueryResult" to store all the attributes of the query result (e.g. normal)
      [NRICP] Add "query" method for Geometry3D object and childs. Added kdtree to PointCloud in a similar way to Trimesh
      [NRICP] Added tests for query_from_points and query_from_mesh functions
      [NRICP] Accounted changes for "query" method in "nricp" function -> a lot of code is removed
      [NRICP] Added a more clear example for nricp
      [NRICP] Add face neighborhood computation (faces that share at least one vertex)
      [NRICP] Added method to NearestQueryResult to check if it contains normals or interpolated normals
      [NRICP] 1/ Implementation of [Sumner and Popovic 2004 Deformation Transfer for Triangle Meshes] but only the correspondence computation part which is a Non Rigid ICP. The implementation is very similar to Ambergs NRICP 2/ Source landmarks must be vertex indices or triangle indices + barycentric coordinates 3/ target positions (landmark) must be (n,3) positions
      [NRICP] Add query method to Scene and Add an example of nricp
      [NRICP] Small documentation fix
      [NRICP] Allow using correspondence cost at first iteration if landmarks are not used in nricp_sumner
      [NRICP] Update tests for nricp_amberg and nricp_sumner
      [NRICP] Flake8 formatting
      [NRICP] Fix scipy.sparse import in registration.py
      [NRICP] Removed dataclass usage (not working on py2.7 apparently). NearestQueryResult is now a regular class.
      [NRICP] Add face_pairs_type option in nricp_sumner
      [NRICP] use of weighted_vertex_normals instead of recreating a Trimesh at each step in nricp_sumner
      [NRICP] same fix but in a cleaner way
      [NRICP] fix silly bug

Jann Poppinga (5):
      Support non-standard files, e.g. from io
      Test for io.BufferedRandom support
      Comment to satisfy formatting style
      Adding blank line for formatting rules
      All formatting errors resolved

Jaron Maene (1):
      bugfix: find ply textures with spaces in filepath

Michael Dawson-Haggerty (30):
      test voxel export roundtrip and add packing import to release
      formatting
      flake8
      fix typo
      remove pyinstrument from test
      fix texture files with spaces in obj
      flake8
      do slicing in numpy
      switch back to bytes wangling
      update test data
      add interleaved test
      version bump and flake8 test_gltf
      switch from diff to just subtract in arc_center
      registration tests
      update gltf validator
      remove debug
      try to address KhronosGroup/glTF-Validator/issues/154
      switch back to older validator
      add warning for uint32
      move failing custom attributes down
      fix test without gltf validator
      remove unsupported workers arg
      check numerrors
      fix #1639
      typo
      remove flakey test
      pass kwargs through to procrustres
      add test for #1647
      flake8
      flake8

Michał Górny (1):
      rename blender_boolean.py template to avoid byte-compilation errors

Till Schnabel (2):
      Added a weighting scheme to procrustes analysis to enable correction of noisy data points.
      Added some more comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants