heightfieldShape sleep?

Grom

10-03-2007 10:56:59

As you know I'm working on integrating NxOgre with the PLSM2. Right now I have a set of 9 heightfieldShapes that follow the camera around on the terrain. When you cross from the center shape to one of the ones on the border, it updates all 9 and sets it up so that you are once again located in the center heightfieldShape.

Is there any other performance enhancing method I might want to employ, like a sleep state for the heightfield shapes along the border or something? It works well right now, especially since the size of the tiles can be easily shrunk/grown, but I'm just wondering if there's any tiny little other optimizations to make.

betajaen

10-03-2007 11:05:18

The heightfields bodies would be "asleep" because they are static.

I have a few ideas though:

- Send any bodies in the non-center height field to sleep.
- Set the furthest bodies away to kinetic, or turn of collisions all together.
- Serialise them, and delete the actor instances.

The last one is overkill and may do more harm than good.

What FPS are you getting with 9 height fields and around 100 cubes?

Grom

10-03-2007 12:00:33

Really the NX Impact is negligible compared to the PLSM2s whole system. With 100 boxes and a full view of the terrain in frame I get ~ 270 fps. And that's with ~ 140 meter radius around the camera of heightfieldShape. I still have a couple bugs to work out, and then I'm going to write a whole serializing system for it. :roll: I'm also going to allow the user to selectively add active heightmaps onto the map so that you can still get physics on distant patches of land.

Grom

10-03-2007 16:05:58

I've got the serialization stuff working now, it generates and uses an 18 meg file that contains all the collision data and streams it in as you move around. Very fast, no stutter when you load in new tiles and delete old ones.

Check it out 210 boxes:

betajaen

10-03-2007 18:31:41

Great Mooogly Googly!! :shock: