habitat-lab icon indicating copy to clipboard operation
habitat-lab copied to clipboard

HITL: Limit amount of float decimals in JSON transmissions.

Open 0mdc opened this issue 1 year ago • 1 comments

Motivation and Context

This uses the gfx_replay_manager API introduced here to limit the amount of floating point decimals used in HITL JSON serialization.

How Has This Been Tested

Tested locally. Verified that this doesn't introduce z-fighting.

Types of changes

  • [Development]

Checklist

  • [x] My code follows the code style of this project.
  • [x] I have updated the documentation if required.
  • [x] I have read the CONTRIBUTING document.
  • [x] I have completed my CLA (see CONTRIBUTING)
  • [x] I have added tests to cover my changes if required.

0mdc avatar Feb 09 '24 18:02 0mdc

Are you sure about 3 places? GPT says a quaternion error could be as high as 3.6 degrees.

Great question. I've been running exclusively from this code for a while now. Axis-aligned quaternions don't show precision issues, and animations are smooth (testing with skinned mesh animations).

That aside, I believe that we don't have calculations that strictly depend on having normalized quaternions. As a rule of thumb, we should never trust serialized quaternions to be normalized.

Initially, I was mostly concerned with Z-fighting as HSSD has lots of co-planar geometry (carpets, wall art, ...). This also works fine after decreasing prevision.

0mdc avatar Feb 14 '24 20:02 0mdc

Changed to 4 decimal places.

0mdc avatar Mar 06 '24 04:03 0mdc