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

Fbx GeometricTransformation support is problematic #56

Open
hu-xd opened this issue Apr 28, 2024 · 5 comments · May be fixed by #58
Open

Fbx GeometricTransformation support is problematic #56

hu-xd opened this issue Apr 28, 2024 · 5 comments · May be fixed by #58
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@hu-xd
Copy link
Contributor

hu-xd commented Apr 28, 2024

Godot version

Fbx2Gltf commit 6154391

System information

Windows 11

Issue description

Fbx GeometricTransformation support is problematic
See Code, current logic is "Apply the geometric transform to the mesh geometry (vertices, normal etc.)"

but this is problematic since a mesh can be shared by several nodes with different GeometricTransformation, so in this scenario, effectively only 1 node will actually use its GeometricTransformation, other nodes' GeometricTransformation-s will be ignored, since the mesh/surface will only be loaded once.

Steps to reproduce

Build an model in 3DMax with several nodes that share the same mesh/instance but with different object-offset, export it as FBX.
Convert the FBX file to GLTF/GLB with Fbx2Gltf.
View the GLB file and see those geometries are incorrect.

Minimal reproduction project

N/A

@hu-xd
Copy link
Contributor Author

hu-xd commented Apr 28, 2024

Fix proposal: Do not apply the GeometricTransformation to the vertices/normals, instead, if GeometricTransformation exists, create another GltfNode as the child of current node, use the GeometricTransformation as the transformation of that child node, and attach the GltfMesh to that child node.

@fire
Copy link
Member

fire commented Apr 28, 2024

We don't have an approach to solving geometric transformations in fbx2gltf.

We have a private test case for geometric transformations that passes with the new godotengine/godot#81746 ufbx implementation. Godot Engine is moving to a new ufbx implementation so FBX2gltf will have less enhancements done for it.

If you wish to provide a pull request for fixing geometric transforms we can review.

@fire fire added bug Something isn't working help wanted Extra attention is needed labels Apr 29, 2024
@hu-xd
Copy link
Contributor Author

hu-xd commented Apr 29, 2024

What do you think of the fix proposal above ?
I see OpenSceneGraph has a similiar solution: insert a layer in the node hierachy to hold the geometric transform.
See Here

@fire
Copy link
Member

fire commented Apr 29, 2024

It might work.

@hu-xd hu-xd linked a pull request Apr 29, 2024 that will close this issue
@fire
Copy link
Member

fire commented Sep 10, 2024

We added geometric helpers to ufbx support. https://godotengine.org/article/introducing-the-improved-ufbx-importer-in-godot-4-3/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants