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

Uint16 check #243

Merged
merged 4 commits into from
Mar 3, 2017
Merged

Uint16 check #243

merged 4 commits into from
Mar 3, 2017

Conversation

likangning93
Copy link
Contributor

Resolves #230.

combinePrimitives now checks if a group of primitives to be concatenated can be concatenated without overflowing uint16 (or uint32, although a primitive that big scares me), and if not, it splits the group into two or more groups.

I got all excited at first thinking this was some kind of knapsack problem, but then I found out it's kind of more like the bin packing problem but possibly more complex. I tried adapting the first fit decreasing strategy, and under testing in a separate project it seems the implementation at least produces 'correct' results.

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 23, 2017

Thanks @likangning93! @lilleyse can you please review?

Also note that this will be a non-issue with glTF 2.0, CC @lasalvavida, and we'll want to have fewer primitives so we have better batching and rendering performance.

@lilleyse
Copy link
Contributor

lilleyse commented Mar 3, 2017

@tfili Does this PR work for your use case?

@lilleyse
Copy link
Contributor

lilleyse commented Mar 3, 2017

The code and tests look good to me.

@tfili
Copy link

tfili commented Mar 3, 2017

@tfili Does this PR work for your use case?

Yep

@lilleyse lilleyse merged commit ba06022 into master Mar 3, 2017
@lilleyse lilleyse deleted the uint16-check branch March 3, 2017 20:25
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.

4 participants