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

Add UV2 morph support and load UV and UV2 morph targets from glTF #15602

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chubei-urus
Copy link
Contributor

I'm opening this PR following the suggestion in https://forum.babylonjs.com/t/morph-uv2-and-import-the-morph-target-from-gltf/53558/2.

The PR adds uv2 morphing to the built-in materials as well as the morph target block in the node material. It also modifies the glTF loader to load the TEXCOORD_0 and TEXCOORD_1 morph target attributes.

@chubei-urus
Copy link
Contributor Author

To reviewer: I'm not sure how to test the code changes. I only know it works because I have a downstream application that uses node material. Haven't tested other materials at all.

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 19, 2024

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 19, 2024

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 19, 2024

Copy link
Member

@sebavan sebavan left a comment

Choose a reason for hiding this comment

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

The code looks really solid at a first glance, I ll let @deltakosh validate and @bghgary for the gltf part

@sebavan
Copy link
Member

sebavan commented Sep 19, 2024

@chubei-urus can you add a gltf visualization test ? so it would not experience nme but already a big part of the code.

@chubei-urus
Copy link
Contributor Author

@chubei-urus can you add a gltf visualization test ? so it would not experience nme but already a big part of the code.

Sure @sebavan! Do you have any pointers on where to add that?

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 19, 2024

@sebavan
Copy link
Member

sebavan commented Sep 19, 2024

@chubei-urus can you add a gltf visualization test ? so it would not experience nme but already a big part of the code.

Sure @sebavan! Do you have any pointers on where to add that?

you can add a test model in https://github.com/BabylonJS/Assets and then follow the contributing doc here to add the new test https://doc.babylonjs.com/contribute/toBabylon/HowToContribute#visualization-tests Do not hesitate to provide doc feedback so we can improve it if needed :-)

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 19, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 19, 2024

Visualization tests for WebGL 1 have failed. If some tests failed because the snapshots do not match, the report can be found at

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/15602/merge/testResults/webgl1/index.html

If tests were successful afterwards, this report might not be available anymore.

@noname0310
Copy link
Contributor

Seems like some WGSL shader updates are missing, is this PR still a draft?

Copy link
Contributor

@deltakosh deltakosh left a comment

Choose a reason for hiding this comment

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

We need to also update all the missing wgsl shaders

@chubei-urus
Copy link
Contributor Author

Seems like some WGSL shader updates are missing, is this PR still a draft?

I didn't know how to run the vis tests locally. I'll convert to draft and fix the errors before requesting review again.

@chubei-urus chubei-urus marked this pull request as draft September 19, 2024 20:07
@bghgary
Copy link
Contributor

bghgary commented Sep 20, 2024

The code looks really solid at a first glance, I ll let @deltakosh validate and @bghgary for the gltf part

Looks good from the glTF perspective. The spec says this FYI:

Client implementations SHOULD support at least three attributes — POSITION, NORMAL, and TANGENT — for morphing. Client implementations MAY optionally support morphed TEXCOORD_n and/or COLOR_n attributes.

@RolandCsibrei
Copy link
Contributor

RolandCsibrei commented Sep 28, 2024

Seems like some WGSL shader updates are missing, is this PR still a draft?

I didn't know how to run the vis tests locally. I'll convert to draft and fix the errors before requesting review again.

@chubei-urus
This might help you to create the visualization tests if you you didn't create the tests yet:
https://forum.babylonjs.com/t/visualization-tests/41753

@deltakosh
Copy link
Contributor

Hey there! any update?

@chubei-urus
Copy link
Contributor Author

Hi! I haven't found time to work on this PR yet.

Copy link

github-actions bot commented Nov 6, 2024

This pull request has been marked as stale because it has been inactive for more than 14 days. Please update to "unstale".

@github-actions github-actions bot added the stale label Nov 6, 2024
@@ -155,7 +158,7 @@ fn main(input : VertexInputs) -> FragmentInputs {
#if defined(ALPHATEST) && defined(ALPHATEST_UV1)
vertexOutputs.vUV = (uniforms.diffuseMatrix * vec4f(uvUpdated, 1.0, 0.0)).xy;
#else
vertexOutputs.vUV = input.uv;
vertexOutputs.vUV = uvUpdated;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about this. Looks like we should use uvUpdated instead of input.uv?

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 7, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants