Mesh scaling factor madness #15811
Labels
Bug
Issues that were confirmed to be a bug
@ Client rendering
@ Documentation
Improvements or additions to documentation
Problem
We are in a weird situation regarding mesh scaling.
breakages.md
says:There is a vague hint of the same multiplier in
lua_api.md
, but.. it isn't stated explicitly?I would have expected one of two things:
Neither is the case. What actually seems to be the case:
.obj
models use 1x space for nodes and 10x space for entities.SkinnedMesh
models (.b3d
,.gltf
) use 10x space for both nodes and entities.This is due to a bug in the code which causes
SkinnedMesh
es not to be scaled when used for nodes:resetAnimation
overwrites the scaled vertices in the mesh buffers with unscaled vertices from the weights.The bug was accidentally fixed for most models in 2143709: Recalculating normals ended up calling
resetAnimation
.By not recalculating normals anymore for many models, these models would now be properly scaled.
Mods / games that had adapted to the wrong scaling (like Wuzzy's eyeballs) would now have nodes that were too large by a factor of 10: #15576, and the bug was put back in to fix it: d4ccc8d.
Solution
We should probably document the status quo more accurately, both in
breakages.md
but more importantly inlua_api.md
.We probably don't want to break such fundamental scaling factors, so we probably have to keep this inconsistent inconsistency around as-is, including
.obj
not requiring the 10x scale factor for nodes.We should then also clean up the code and explicitly just not scale skinned meshes to begin with.
The text was updated successfully, but these errors were encountered: