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

Split techniques for primitives that use different attributes #430

Merged
merged 2 commits into from
Nov 2, 2018

Conversation

lilleyse
Copy link
Contributor

Take into account whether a primitive has normals or texture coordinates when deciding whether to split incompatible techniques/materials.

This targets the 1.0 branch.

@coveralls
Copy link

coveralls commented Oct 30, 2018

Coverage Status

Coverage increased (+0.004%) to 93.982% when pulling 3b34ed4 on separate-techniques-by-attributes into 5048011 on 1.0.

@likangning93 likangning93 self-assigned this Oct 30, 2018
@likangning93
Copy link
Contributor

@lilleyse works as described for input gltf that already has KHR_materials_common, but should this also address generally when a primitive doesn't have enough attributes for the specified material/technique? Models without kmc that run with kmc output also don't hit this code path.

@lilleyse
Copy link
Contributor Author

lilleyse commented Nov 2, 2018

should this also address generally when a primitive doesn't have enough attributes for the specified material/technique

I'm not totally sure what the spec would say about that, but it sounds like that model would be invalid.

Models without kmc that run with kmc output also don't hit this code path.

I think by this point a valid glTF would have already been split already, so the same kmc material wouldn't be used by two primitives with different attributes.

@@ -325,4 +325,84 @@ describe('processModelMaterialsCommon', function() {
expect(techniqueVec4.parameters.joint.type).toEqual(WebGLConstants.FLOAT_VEC4);
expect(techniqueMat3.parameters.joint.type).toEqual(WebGLConstants.FLOAT_MAT3);
});

it('splits two materials with different attributes', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small thing: I'm reading this spec title as "splitting two materials," like splitting two materials into four materials, instead of something like "splits a material used by meshes with different attributes."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. I used your wording.

@likangning93 likangning93 merged commit 495c984 into 1.0 Nov 2, 2018
@likangning93 likangning93 deleted the separate-techniques-by-attributes branch November 2, 2018 19:39
@likangning93
Copy link
Contributor

Thanks @lilleyse!

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.

3 participants