Hi my simulation FPS dropped significantly after adding constraints.
Is there any clue why is constraint eating so much memory?
I suppose it should not drop so much where I have only 50 objects (mostly cube / sphere),
and the constraint is of type btHingeConstraint.
Is there any way to boost up the performance of FPS?
Thank you.
FPS dropped significantly after adding Constraints
-
- Posts: 41
- Joined: Wed Nov 20, 2013 4:14 pm
-
- Posts: 463
- Joined: Fri Nov 30, 2012 4:50 am
Re: FPS dropped significantly after adding Constraints
Are you using release build or debug? If it's debug there's a chance it can take more than 15ms to calculate, but release should be good for a bit more (depends on computer and just what those objects are doing). Joining everything with joints can take a toll though.
-
- Posts: 41
- Joined: Wed Nov 20, 2013 4:14 pm
Re: FPS dropped significantly after adding Constraints
Hi thanks for reply,
Yah it is under release mode,
I didn't vsync up with my pc, so letting it to boost up the maximum performance,
I had even turned on to the best pc performance.
The original scene is taking 150fps (under release mode),
but after adding the 1st constraint (btHingeConstraint),
it significantly dropped to about 110 fps,
subsequently adding few more (probably 5-10+ constraints) eventually dropped to 30+ fps,
to me this doesn't look good because i am still in the middle of development and might add in new features in future.
Any recommendation?
Thank you =)
Yah it is under release mode,
I didn't vsync up with my pc, so letting it to boost up the maximum performance,
I had even turned on to the best pc performance.
The original scene is taking 150fps (under release mode),
but after adding the 1st constraint (btHingeConstraint),
it significantly dropped to about 110 fps,
subsequently adding few more (probably 5-10+ constraints) eventually dropped to 30+ fps,
to me this doesn't look good because i am still in the middle of development and might add in new features in future.
Any recommendation?
Thank you =)
-
- Posts: 74
- Joined: Thu Feb 10, 2011 8:27 pm
Re: FPS dropped significantly after adding Constraints
Are you only adding one constraint in total, or one constraint per object?
It seems unusual, as I have a sample scene with one of every constraint running, noticeable performance change, but there is only 2 objects per constraint.
It seems unusual, as I have a sample scene with one of every constraint running, noticeable performance change, but there is only 2 objects per constraint.
-
- Posts: 41
- Joined: Wed Nov 20, 2013 4:14 pm
Re: FPS dropped significantly after adding Constraints
Adding one constraint per 2 objects (constraints applied to atleast 2 objects) in my case.
Note : My iteration solver is around 100-500 cycles.
Note : My iteration solver is around 100-500 cycles.
-
- Posts: 149
- Joined: Fri May 24, 2013 6:08 am
Re: FPS dropped significantly after adding Constraints
You are doing 500 iterations in the solver and you are surprised at the FPS drop
-
- Posts: 41
- Joined: Wed Nov 20, 2013 4:14 pm
Re: FPS dropped significantly after adding Constraints
Upss sorry, i mean i tested with 100-500 iterations range, all are dropping significantly after first constraint.
Plus, if i don't set the iterations high enough, the objects are like swinging and fall off from its original pivots, which looks ugly ;'O
Plus, if i don't set the iterations high enough, the objects are like swinging and fall off from its original pivots, which looks ugly ;'O
-
- Posts: 463
- Joined: Fri Nov 30, 2012 4:50 am
Re: FPS dropped significantly after adding Constraints
Tried the featherstone multi-body or dantzig solver? They help keep iterations low, though dantzig with 50 objects might not give that great of results (speed wise) as it's currently set up.papaonn wrote:Upss sorry, i mean i tested with 100-500 iterations range, all are dropping significantly after first constraint.
Plus, if i don't set the iterations high enough, the objects are like swinging and fall off from its original pivots, which looks ugly ;'O
You can also try just overriding the joint iterations, rather than all constraints. It'll improve speed a bit if you have a lot of contact points.
-
- Posts: 41
- Joined: Wed Nov 20, 2013 4:14 pm
Re: FPS dropped significantly after adding Constraints
Hi Basroil, thanks for replying,Basroil wrote: Tried the featherstone multi-body or dantzig solver? They help keep iterations low, though dantzig with 50 objects might not give that great of results (speed wise) as it's currently set up.
You can also try just overriding the joint iterations, rather than all constraints. It'll improve speed a bit if you have a lot of contact points.
By overriding joint iterations meaning?
I can narrow down several stuffs that i don't need in current iteration solver?
Could you explain more in details and examples if you don't mind =)
Thanks !
-
- Posts: 463
- Joined: Fri Nov 30, 2012 4:50 am
Re: FPS dropped significantly after adding Constraints
You can make different joints have different solver iterations, so if joint A is really necessary you can make it 200 iterations, and make everything else the default 10. The best thing is to look at the dynamic control demo (motor demo) and apply this line to TestRig::TestRig in the code where the joint constraint is made.papaonn wrote:By overriding joint iterations meaning?
I can narrow down several stuffs that i don't need in current iteration solver?
Code: Select all
hingeC->setOverrideNumSolverIterations(JointIterationCount);
Doing that you can make friction and contact constraints default, but make joint constraints much stiffer (won't droop)