o3de / o3de-extras

Other
61 stars 61 forks source link

FollowingCamera component shakes a lot #702

Closed Fireronin closed 2 months ago

Fireronin commented 3 months ago

Describe the bug Following Camera creates lot's of shaking when the object stops, and starts moving, this happens when this behavior via imgui.

Steps to reproduce Steps to reproduce the behavior:

  1. Create object that move with random jumpy motion
  2. Add following camera with with smoothing length set to 10
  3. In game start and stop this object with imgui

Expected behavior Camera moves smoothy object moves in jagged motion.

Actual behavior At the start everything is fine, after stopping and starting objects movement camera jumps a loot creating blurry image.

Commit ID from o3de/o3de and o3de/o3de-extras repositories O3DE = tag: 2023.3 o3de-extras = commit id: 8297322

Desktop/Device (please complete the following information):

Additional context In my experiments this this issue wasn't present when object moved few times per second, but was quite visible when movement happened around 15 times per second.

michalpelka commented 3 months ago

Could you provide a video or level to reproduce? Without that, we cannot produce it. The algorithm for camera smoothing is a simple low-pass filter implemented on quaternions and vectors. Please provide me exact failing use case. Note that what you expect in Expected behavior cannot be done in my opinion with this component. If you shake an object randomly (white noise assumption), you introduce a noise energy in a whole frequency spectrum. The smoothing is done via a low-pass filter. Those filters have some amount of damping of high-frequency signals, but cannot magically find what is a signal and what is a noise. It is based on the assumption that noise is rather high frequency (e.g. robot that drives on uneven terrain). I can two possibilities to solve this problem:

I also cannot understand what you mean by blury image. Currently, we have no motion blur implemented, and Atom does not simulate exposure-time blurring. I think that issue is not valid here, but to be 100% percent sure, please provide me a with repoduction.

michalpelka commented 3 months ago

I suggest a reproduction as some lua script that will shake an object similar to what you observe in your project

jhanca-robotecai commented 2 months ago

I am closing this issue based on the missing reproduction. Please reopen when ready.