-
Notifications
You must be signed in to change notification settings - Fork 427
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
Bugfix: Some objects have invalid scales when replay rendering #2200
Conversation
@@ -296,14 +296,14 @@ bool BulletPhysicsManager::attachLinkGeometry( | |||
Mn::Color4(material->m_matColor.m_specularColor); | |||
} | |||
|
|||
auto scale = Mn::Vector3{1.0f, 1.0f, 1.0f}; |
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.
This probably needs to be scaled by the global scale specified in ao_config.json and accessed by artObjAttributes->getUniformScale()
(see line 166 above).
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 global scale is already applied.
Model::setGlobalScaling
in URDFParser.cpp
sets m_meshScale
, m_boxSize
, m_sphereRadius
, etc., which are applied below.
It's a bit confusing though, as GlobalScale/ing
and UniformScale/ing
names are used interchangeably but aren't directly applied.
Marge |
Is there any testing for this? |
af63cea
to
5152d8b
Compare
5152d8b
to
a3c80f0
Compare
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.
LGTM once tests pass :)
Motivation and Context
When replay rendering (from the classic replay renderer, batch renderer, Unity or Blender), some objects have incorrect scaling.
In Habitat, the scale of nodes comes from two sources:
CreationInfo scale
, which is typically user-defined.asset scale
. GLTF files (and other complex formats) are composed of nodes that can be scaled. Those are artist-defined.All importers will automatically apply the
asset scale
when loading a model.To obtain the desired scale, we must multiply the
CreationInfo scale
withasset scale
.Because the recorder is writing the final scale (
CreationInfo scale
*asset scale
) into keyframes, the renderers apply theasset scale
twice when loading assets.This changeset fixes replay renderer scaling by ensuring that only the
CreationInfo scale
is recorded, as theasset scale
is already defined in the model.Note: Upon importing URDF files, the graphics nodes were scaled directly rather than passing the information through
CreationInfo
. This would "hide" URDF scaling from gfx-replay.The figure below shows results in Unity. Note that the behavior is the same in Blender, classic and batch replay renderers.
How Has This Been Tested
Tested locally on classic and Unity replay renderers.
Types of changes
Checklist