KhronosGroup / KhronosGroup/COLLADA2GLTF
Linestrips and other primitive types are not supported
- Dominant language
- C++
- Stars
- 573
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
LINE_STRIPS, TRIANGLE_STRIPS and TRIANGLE_FANS do not appear to be supported.
Suprisingly, [Converter Limitations Wiki](https://github.com/KhronosGroup/COLLADA2GLTF/wiki/Converter-Limitations) does not mention the lack of supported types.
The converter currently supports LINES, TRIANGLES, POLYLIST, and POLYGONS primitive types where the last two are converted to TRIANGLES. See [convert/meshConverter.cpp](https://github.com/KhronosGroup/COLLADA2GLTF/blob/master/convert/meshConverter.cpp#L504).
LINES was the most recently added type when this project was under glTF project (https://github.com/KhronosGroup/glTF/pull/302) and can be used as a guide to add other types.
It is trivial to allow LINE_STRIPS but most of the work seems to be in [helpers/geometryHelpers.cpp](https://github.com/KhronosGroup/COLLADA2GLTF/blob/master/helpers/geometryHelpers.cpp#L687) to support splitting the primitive's mesh into separate meshes when source mesh is too big (limit num indices to < 65536). On investigation, I believe this method contains bugs such as `primitiveCompleted` is set to true to close a sub mesh at the end of the loop but never reset to false so additional sub meshes will closed with very little data in them.
I was going to add full support for the missing types but I have no confidence in making changes without unit tests or even a set of COLLADA models and expected glTF output files to compare the result.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in convert/meshConverter.cpp around the existing primitive handling, using LINES as the guide, then inspect helpers/geometryHelpers.cpp around the mesh-splitting logic. Confirm how LINE_STRIPS, TRIANGLE_STRIPS, and TRIANGLE_FANS should be converted and verify splitting at the 65536-index limit. Done means all three types convert correctly, including large meshes, with COLLADA fixtures and expected glTF output for regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100