Skip to content
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

Lessen the jittering of the blocks #240

Open
Theonlyhamstertoh opened this issue Jul 26, 2021 · 4 comments
Open

Lessen the jittering of the blocks #240

Theonlyhamstertoh opened this issue Jul 26, 2021 · 4 comments

Comments

@Theonlyhamstertoh
Copy link

This issue is connected with #177.

According to this issue on cannonjs , this jittering of objects also exists in cannonjs. I examine the jenga example in cannon-es and after some time, the jenga example will fall, so also exists in cannon-es.

I did a test in this demo sandbox using use-cannon and cannon-es and you can see that the use-cannon blocks are still jittering after landing on ground. I increase gravity to -100 to make it more apparent on the movement. The result is that both are moving with close inspection of the blocks but the blocks in use-cannon are much more strong than the movement in cannon-es.

If you were to subscribe to the use-cannon block with api, velocity never reaches zero.

If the vibration of the blocks exists in all three packages, then is it possible to lessen the jittering in use-cannon?

@calvind777
Copy link

I'm not super familiar with this project so I'm not sure why this happens, but this exact same issue happened to me when upgrading to 2.6.0 from 2.2.0. For a quick fix, you could try downgrading to 2.2.0.

@danfmn
Copy link

danfmn commented Nov 22, 2021

I'm also experiencing this issue.
I've noticed that depending on the force of gravity, that will determine how jittery or shaky the objects will be. Setting the gravity to 0 removes the jitter, however is not ideal in most cases. I've attempted adjusting properties related to sleeping, however none seem to have an impact. I've also attempted to downgrade to 2.2.0 and the issue persists. Is there any follow up in regards to this issue?

Here's a video
https://streamable.com/9gw04z
Notice how there is no shaky when there is no collision, however as soon as the boxes hit the plane, the boxes shake. ( The movement is intentional steering behavior, however it's being poorly effected by the bouncing. )

@drcmda
Copy link
Member

drcmda commented Nov 22, 2021

@bjornstar @codynova this was also reported on discord,

Hello everyone! 👋

I'm facing weird performance issues when updating packages:
react-three-fiber -> @react-three/fiber
use-cannon -> @react-three/cannon
older version of @react-three/drei

It's happening when changing camera position and rotation same time.

Expected (first part of the video): Smooth render without stuttering.. This is the case when using "react-three-fiber": "^6.0.13", "use-cannon": "^0.5.3" and "@react-three/drei": "^3.8.6"
Application: (https://codesandbox.io/s/minecraft-forked-qrjq5)

Result (second part of the video): With new updated packages changing camera position and rotation same time renders with weird stuttering. It's using latest packages: "@react-three/cannon": "4.0.1", "@react-three/fiber": "7.0.17" and "@react-three/drei": "7.3.1"
Application: (https://codesandbox.io/s/minecraft-new-packages-b5efn)

Any idea what would cause this? Code-wise nothing has changed.. Only packages updated.

https://codesandbox.io/s/minecraft-forked-qrjq5 (no vibration) https://codesandbox.io/s/minecraft-new-packages-b5efn (vibration)
found it! it's in cannon between v0.5.4 -> v0.5.5
@paulhenschel most likely this: #160

something about a fixed time step. the change is between 0.5.4 and 0.5.5

r3f-performance-issue.mov

@bjornstar
Copy link
Member

@bjornstar @codynova this was also reported on discord,

Hello everyone! 👋
I'm facing weird performance issues when updating packages:
react-three-fiber -> @react-three/fiber
use-cannon -> @react-three/cannon
older version of @react-three/drei
It's happening when changing camera position and rotation same time.
Expected (first part of the video): Smooth render without stuttering.. This is the case when using "react-three-fiber": "^6.0.13", "use-cannon": "^0.5.3" and "@react-three/drei": "^3.8.6"
Application: (https://codesandbox.io/s/minecraft-forked-qrjq5)
Result (second part of the video): With new updated packages changing camera position and rotation same time renders with weird stuttering. It's using latest packages: "@react-three/cannon": "4.0.1", "@react-three/fiber": "7.0.17" and "@react-three/drei": "7.3.1"
Application: (https://codesandbox.io/s/minecraft-new-packages-b5efn)
Any idea what would cause this? Code-wise nothing has changed.. Only packages updated.

https://codesandbox.io/s/minecraft-forked-qrjq5 (no vibration) https://codesandbox.io/s/minecraft-new-packages-b5efn (vibration)
found it! it's in cannon between v0.5.4 -> v0.5.5
@paulhenschel most likely this: #160

something about a fixed time step. the change is between 0.5.4 and 0.5.5

r3f-performance-issue.mov

This was reported as issue #293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants