Page 1 of 1

Physics shapes of LOD objects

PostPosted: 12 Jul 2012, 10:32
by Wolfs
I was just wondering which shapes of LOD objects are used in the physics. It seems to me that the models with the highest resolution are choosen.
unnamed-track-physics.png

As you can see, the track uses lots of lanterns, and the lanterns in turn are using LOD. I think it would be helpful for the performance of the track if the shapes of the lanterns in the physics would be the ones of LOD models with lower resolutions, for example one with about 15 faces. Is it somehow possible to do this? The track in the picture is using relatively few faces and has nevertheless a rather bad frame rate, and I don't really want to reduce the number of faces used in the lantern model with the highest resolution since the player can get very near to them :).

Re: Physics shapes of LOD objects

PostPosted: 12 Jul 2012, 12:06
by betharatux1
wow ... :o which way kart will be race on picture, right or left ? :think:

Re: Physics shapes of LOD objects

PostPosted: 12 Jul 2012, 12:14
by betharatux1
LOD ? what its that + mean + use for ? :|
i don't know for sure mean your posted but if that track has no problem when did exported and tested... :think:
it seems okay ... ;)

Re: Physics shapes of LOD objects

PostPosted: 12 Jul 2012, 12:47
by Arthur

Re: Physics shapes of LOD objects

PostPosted: 12 Jul 2012, 12:55
by Wolfs
betharatux1 {l Wrote}:wow ... :o which way kart will be race on picture, right or left ? :think:

The karts will be driving on the right way.

betharatux1 {l Wrote}:LOD ? what its that + mean + use for ? :|
i don't know for sure mean your posted but if that track has no problem when did exported and tested... :think:
it seems okay ... ;)

"LOD" is short for "Level of detail", see this page (http://supertuxkart.sourceforge.net/Track_Maker%27s_Guide_2#Level_of_Detail).
The problem is that the lanterns have by far more faces for the physics (collision behaviour is separated from the graphics) than necessary. You can see the physics triangles in the picture: They are marked with green edges, the normals of those faces are painted in yellow.
In short I am asking whether it is possible to use a different collision shape for the lanterns in the same way you can see on the wilber kart: Wilber consists of lots of triangles, but his collision shape (painted in red) just uses a few faces. Reducing the faces the physics have to work on will hopefully make my level faster. The player, on the other hand, will notice no difference if he crashes into a cube or into a very detailed cylinder, because the lanterns are quite slim.

Re: Physics shapes of LOD objects

PostPosted: 13 Jul 2012, 00:30
by hiker
Wolfs {l Wrote}:As you can see, the track uses lots of lanterns, and the lanterns in turn are using LOD. I think it would be helpful for the performance of the track if the shapes of the lanterns in the physics would be the ones of LOD models with lower resolutions, for example one with about 15 faces. Is it somehow possible to do this? The track in the picture is using relatively few faces and has nevertheless a rather bad frame rate, and I don't really want to reduce the number of faces used in the lantern model with the highest resolution since the player can get very near to them :).

I think it's unlikely that the bad frame rate is caused by the physics, in (afaik) any case we have seen this is caused by the graphics only, either because of the track or (too many) karts. It could even just be the graphics of the lantern. Note that the mesh for each lantern will be transferred separately to the graphics card, it's not that the mesh is only sent once with various locations or so.

You can easily confirm this by setting the lanterns to be ignored by the physics.

Cheers,
Joerg

Re: Physics shapes of LOD objects

PostPosted: 14 Jul 2012, 00:18
by Auria
Hi,

I can confirm that the highest level is used. But as Joerg said, physics is usually not a bottleneck. The reason is that rendering is much more costly : when rendering, you need to render everything visible. When doing physics, the game only needs to check against nearby stuff. So physics are generally much much faster than rendering

Re: Physics shapes of LOD objects

PostPosted: 14 Jul 2012, 11:27
by Wolfs
Auria {l Wrote}:I can confirm that the highest level is used. But as Joerg said, physics is usually not a bottleneck. The reason is that rendering is much more costly : when rendering, you need to render everything visible. When doing physics, the game only needs to check against nearby stuff. So physics are generally much much faster than rendering

Alright, in that case I guess that I cannot improve the framerate further. Thanks for your help :).