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 4 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
@bjsplat
Copy link
Collaborator

bjsplat commented Nov 7, 2024

@sebavan sebavan requested a review from Popov72 November 26, 2024 17:19
Copy link
Contributor

@Popov72 Popov72 left a comment

Choose a reason for hiding this comment

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

packages/dev/core/src/Shaders/default.vertex.fx Outdated Show resolved Hide resolved
packages/dev/core/src/Shaders/pbr.vertex.fx Outdated Show resolved Hide resolved
@sebavan sebavan removed the stale label Nov 26, 2024
@chubei-urus
Copy link
Contributor Author

@sebavan @Popov72 Thank you for the review! I addressed the comments but still haven't got time to add the visualization test yet. Let's keep this PR in draft state?

@Popov72
Copy link
Contributor

Popov72 commented Nov 28, 2024

Yes, we can keep the PR in draft until you add a proper visu test.

@Popov72
Copy link
Contributor

Popov72 commented Dec 9, 2024

@chubei-urus Do you think you can add the visualization test, as we are waiting for this PR to be merged so we can make another one related to morph targets? Thanks in advance.

@chubei-urus
Copy link
Contributor Author

Thanks for the heads up. I'll try to do that within this week.

@chubei-urus
Copy link
Contributor Author

I think I hit an existing bug that's blocking me from adding the vis test. See https://forum.babylonjs.com/t/uv-morphing-results-in-two-textures-of-different-types-use-the-same-sampler-location/55346

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.

8 participants