-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
FBXLoader: Fixed morph attributes to match base geometry length #28397
FBXLoader: Fixed morph attributes to match base geometry length #28397
Conversation
Remove nurbs asset since it already has its own example.
The Stanford bunny is already used in three other examples. Let's only add assets in `webgl_loader_fbx` which are not used elsewhere.
examples/webgl_loader_fbx.html
Outdated
'morph_test' | ||
]; | ||
|
||
const transforms = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think you can update morph_test.fbx
such that no additional transforms are required in the example? Ideally the asset does not need be scaled and translated after the import. That would simplify the example a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I can, however, the existing rabbit is already huge. Should we let it like that ?
I could, re-export the rabbit too to make it have a reasonable size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rabbit is used in other examples and I would not like to touch them now. Notice that I have updated your branch and removed the nurbs and rabbit asset from the demo. They are already used in other demos so in webgl_loader_fbx
I would only add assets which are not used elsewhere.
In any event, an optimized size for the morphed cube would be great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you removed the rabbit and nurbs.
Either we don't show it or I can re-export it (I'll do it in blender if so).
Meanwhile I'll just re-export the test example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed, changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI / E2E testing fail I think it was random. I tested manually that page (webgl_animation_skinning_ik) and looks fine (and it uses a gltf asset anyways).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes we have false-positives. Rerunning the failed job often solves such issues. I'll give it a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example looks good to me!
I'm not really familiar with FBX so I hope @looeee can have a look at the FBXLoader
related changes. He knows the implementation best.
The code looks good to me 👌 |
Fixed #28378
Description
Injected
baseVertexPositions
intogeoInfo
so that insidegenFace
we can generate triangles from real geometry,enforcing faces that are not involved in morph to be pushed into morphAttributes.
genFace
is used when generating base geometry as well as in generating morphs.In
genFace
thevertices
array is just a mean to generate triangles.If we generate
vertices
frommorphPositions
, we wont have triangles for faces not involved in morph,because
ShapeUtils.triangulateShape
returns an empty array of triangles when fed with for [0,0] elementsThat's why we generate them from base geometry.
Later when
buffers.vertex
is being populated, the actual information is retrieved frommorphPositions
.TLDR: we generate triangles from base geometry and based on these triangles we push data that we read from
morphPositions
into the final morph buffers.