-
Notifications
You must be signed in to change notification settings - Fork 133
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
Performance regression #36
Comments
Thanks for the issue and the usage example. |
maybe i am wrong here but the last para should be not the frameRate more a value of 10 for maxSubSteps |
Hello friends, I've discovered the issue. Basically there are tons or commit which are in the cannon.js repo but haven't been published to npm or built into the cannon.js bundle. Here is the full list. Between these commits there is I've tried to fix those issues in #40, but of course I'm not schteppe. If you guys @mrdoob and @Mugen87 could test with the cannon-es bundle from that branch that would be grand 🙏 Also @codynova issue #16 should be fixed as well, could you do a test? 🙏 @arpu is right, the third parameter is used to tell how many maximum internal steps the |
@marcofugaro The performance seems better with your changes. However if I have more than 400 cubes in the scene, the performance drops significantly to an unusable framerate (approx. 8 FPS). This does not happen with the original |
@Mugen87 Oddly enough, that's a feature. If you want the behaviour of the previous cannon.js, you can call However now that you mention it, it makes sense to have the threshold at at least 30fps, not 10. EDIT: I've updated the PR, could you test now? |
@Mugen87 do you have time to test again? 🙏 |
Performance seems better now. Mostly around 25-27 FPS when having 400 cubes in However, the performance of |
Alright, that is working as intended! 🎉 The simulation now has more time to catch up than before, this works in favor of people using cannon.js in a web worker. Users can still get the previous world.step(frameTime, delta, 1) Thanks for testing again! |
So |
Yup, currently in that line, the third parameter It should be called We should really write this stuff in the docs once they are up. |
A new version of cannon-es has been released with Marco's fixes for variable framerate simulation |
We are considering using
cannon-es
in three.js but seems like there's a performance regression.@Mugen87 converted cannon.js to modules and here's the running example:
https://raw.githack.com/mrdoob/three.js/dev/examples/physics_cannon_instancing.html
This is the same example using
cannon-es
:https://raw.githack.com/Mugen87/three.js/dev45/examples/physics_cannon_instancing.html
mrdoob/three.js#19709
The text was updated successfully, but these errors were encountered: