FBX2glTF icon indicating copy to clipboard operation
FBX2glTF copied to clipboard

Fbx GeometricTransformation support is problematic

Open hu-xd opened this issue 1 year ago • 5 comments
trafficstars

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 avatar Apr 28 '24 16:04 hu-xd

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.

hu-xd avatar Apr 28 '24 16:04 hu-xd

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 https://github.com/godotengine/godot/pull/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 avatar Apr 28 '24 17:04 fire

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

hu-xd avatar Apr 29 '24 02:04 hu-xd

It might work.

fire avatar Apr 29 '24 02:04 fire

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

fire avatar Sep 10 '24 21:09 fire