Bugfix: Some objects have invalid scales when replay rendering#2200
Bugfix: Some objects have invalid scales when replay rendering#2200
Conversation
| Mn::Color4(material->m_matColor.m_specularColor); | ||
| } | ||
|
|
||
| auto scale = Mn::Vector3{1.0f, 1.0f, 1.0f}; |
There was a problem hiding this comment.
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.
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
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 scalewhen loading a model.To obtain the desired scale, we must multiply the
CreationInfo scalewithasset scale.Because the recorder is writing the final scale (
CreationInfo scale*asset scale) into keyframes, the renderers apply theasset scaletwice when loading assets.This changeset fixes replay renderer scaling by ensuring that only the
CreationInfo scaleis recorded, as theasset scaleis 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