Skip to content

Support rendering for all glTF primitive modes#702

Merged
azrogers merged 5 commits into
mainfrom
handle-primitive-modes
Jun 24, 2026
Merged

Support rendering for all glTF primitive modes#702
azrogers merged 5 commits into
mainfrom
handle-primitive-modes

Conversation

@j9liu

@j9liu j9liu commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

Depends on #701 so merge that first.

Depends on CesiumGS/cesium-native#1393.

This PR incorporates the above cesium-native PR to render all primitive modes in Unity. Since not all modes are supported out-of-the-box, this uses options in LoadTileset to make cesium-native retopologize as needed.

image
Mode Expected
LINE_LOOP image
LINE_STRIP image
TRIANGLE_STRIP image
TRIANGLE_FAN image

Author checklist

  • I have submitted a Contributor License Agreement (only needed once).
  • I have done a full self-review of my code.
  • I have updated CHANGES.md with a short summary of my change (for user-facing changes).
  • [ ] I have added or updated unit tests to ensure consistent code coverage as necessary.
  • [ ] I have updated the documentation as necessary.

Testing plan

  1. Start from 01_CesiumWorld
  2. Create a new empty game object with a CesiumGeoreference component.
  3. Set the georeference to True Origin
  4. Add a Blank 3D Tileset and load MeshPrimitiveModes.zip.
  5. Also be sure to test the models in primitive-restart-samples.zip for primitive restart support. Edit the tileset.json to change the URL of the referenced .glb.

Confirm that the model matches the above appearance.

Reviewer checklist

Thank you for taking the time to review this PR. By approving a PR you are taking as much responsibility for these changes as the author.

As you review, please go through the checklist below:

  • Review and run all parts of the test plan on this branch and verify it matches expectations.
    • If the issue is a bug please make sure you can reproduce the bug in the main branch and then checkout this branch to make sure it actually solved the issue.
  • Review the code and make sure you do not have any remaining questions or concerns. You should understand the code change and the chosen approach. If you are not confident or have doubts about the code, please do not hesitate to ask questions.
  • Review the unit tests and make sure there are no missing tests or edge cases.
  • Review documentation changes and updates to CHANGES.md to make sure they accurately cover the work in this PR.
  • Verify that the Contributor License Agreement has been submitted, if needed.

@j9liu j9liu changed the title Handle primitive modes Support rendering for all glTF primitive modes Jun 12, 2026
@j9liu j9liu changed the base branch from main to update-native-image June 12, 2026 19:50
@j9liu j9liu requested a review from azrogers June 16, 2026 15:32
@j9liu j9liu self-assigned this Jun 16, 2026
Base automatically changed from update-native-image to main June 22, 2026 22:05
@j9liu

j9liu commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Updated for CesiumGS/cesium-native#1393; turns out that Unity doesn't like when we pass in an index buffer with the primitive restart value (it crashes at MeshData::SetSubMesh), so I avoided using the LineStrip topology entirely.

This is ready for review!

@azrogers

Copy link
Copy Markdown
Contributor

Thanks @j9liu!

@azrogers azrogers merged commit 6e3914f into main Jun 24, 2026
8 checks passed
@azrogers azrogers deleted the handle-primitive-modes branch June 24, 2026 19:57
@j9liu j9liu added this to the July 2026 Release milestone Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants