Weird StaticTriangleGroup frame drop

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Semei
Posts: 3
Joined: Sat Jun 28, 2008 5:34 pm

Weird StaticTriangleGroup frame drop

Post by Semei »

I have weird problem with drastic frame drop using StaticTriangleGroup... When the game starts i got frame time ~1ms, then when more and more collisions StaticTriangleGroup->Sphere had accured the lower the framerate goes... In the end i have like one frame in ~10ms and i shouldn't get so low fps even if i check all mesh triangles every frame... What could be wrong?
User avatar
Zukarakox
Not a Site Admin
Posts: 426
Joined: Mon Jul 10, 2006 4:28 am

Re: Weird StaticTriangleGroup frame drop

Post by Zukarakox »

If the sphere is colliding with more than 4-5 triangles per frame, it could be causing your problem. Also, check your StaticTriangleGroup initalization parameters, the first two, if you have them set to large numbers, could cause a problem.
i has multiple toes
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Weird StaticTriangleGroup frame drop

Post by Norbo »

For it to reach 10 ms for the detection and such under normal conditions, there would need to be on the order of hundreds of collisions going on. If your sphere rolls over many hundreds of triangles and they never poof afterwards, this could cause some slowdowns separate from collision detection. As Zukarakox mentioned, this behavior relates to the timeInterval and maxAge parameters in the constructor. For reference, the demos uses a .5f and 1 value for timeInterval and maxAge respectively.
Semei
Posts: 3
Joined: Sat Jun 28, 2008 5:34 pm

Re: Weird StaticTriangleGroup frame drop

Post by Semei »

I use 0.5 and 1 for times. Note that it causes permanent slowdown and i see that usually sphere collides to one or two triangles. I can just "brush" a bunch of triangles when controlling sphere to collide with them, then fly very far away and wait till framerate returns to starting, but it never happens...
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Weird StaticTriangleGroup frame drop

Post by Norbo »

Would it be possible for you to provide a reproduction case?

The triangles should be disappearing if you have those settings, so now I'm trying to think of more obscure causes of the lag, perhaps related to the broad phase or weirder sources.
Post Reply