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

Support for sparse accessor and accessor without buffer view. #29

Merged
merged 5 commits into from
Feb 5, 2025

Conversation

stripe2933
Copy link
Owner

@stripe2933 stripe2933 commented Feb 5, 2025

This PR adds support for glTF sparse accessor and accessor without buffer view.

Implemented as:

  • For a sparse accessor, their byte data is generated and used as same as the ordinary Accessor in the shader.
  • For an accessor without buffer view,
    • If it is attribute accessor, it uses 16 byte sized zero-filled buffer (which can contain VEC4 type, the largest possible type of accessor). Fetching address will always point to the buffer device address of the buffer, and stride will be set to 0, make every accessor indirection points to the start of the buffer.
    • Otherwise, create a zero-filled buffer with given accessor count and use it.

It also removes the constraint for maximum accessor byte stride (128, previously), which is not likely to be happened.

@stripe2933
Copy link
Owner Author

Tested with following models:

Model Ground Truth Rendered Result
SimpleSparseAccessor SimpleSparseAccessor ground truth image SimpleSparseAccessor rendered result
Accessor_Sparse_02, Accessor_Sparse_03
Accessor_SparseType_05
Accessor_Sparse_02, Accessor_Sparse_03, Acessor_SparseType_05 ground truth image Accessor_Sparse_02, Accessor_Sparse_03, Acessor_SparseType_05 rendered result

@stripe2933 stripe2933 merged commit 9a607b5 into master Feb 5, 2025
3 checks passed
@stripe2933 stripe2933 deleted the accessor branch February 5, 2025 19:14
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.

1 participant