Suggestion to increase the performances of a 3D simulation

Hi,
i am a quite good Java programmer but i have to admit that i am a newby regarding OpenGL and JOGL. I started using this library becouse i am developing a 3D pedestrian mobility simulator where a user can see the movements of many entities inside a 3D environment. The problem is that it could possibly happen that i need to show about 1000 or 2000 moving entities at the same time, at the moment the pedestrian entities are rappresented by spheres or cylinders but i want to work on a 3D skeletal human body to make a better visual simulation for the user, but I fear that this could decrease significantly the performances of the simulator. Can someone help me suggesting some good programming tecniques or paperworks to read to develop a good program that could manage at runtime many 3D animated entities without a significant loss in performances?

you might wanna look into “Vertex Buffer Objects” and “GPU Skinning” for skeletal models.

One of the most important things: LOD (Level of Detail)

I red something about VBO and Displaylist but some people say that vbo are better and some other suggest to use displaylist, actually i don’t know wich is better.

Display lists allow you to store a bunch of geometry + state calls in a single display list object, which will probably be stored in the graphics cards memory and so quick to draw. However display lists can’t be changed once created, so they’re not what you’d use for animation.

VBOs provide an efficient method for getting geometry to the graphics card for drawing. Depending on how you initialise them, geometry may be stored in video card memory, AGP memory or system memory. They can be changed after creation and are generally a more modern replacement for display lists.

I’ve another doubt regarding performances, if i work on making the animations for a human body, is it better to work on a complete body generating its key frames, or is it better to work on a model for every part of the body and generate key frames only for the moving parts? Is there any other tecnique to make human body animation that could be useful for performances in a simulation with about 1000 or 2000 humans walking?

I would skip skeletal animation alltogether, use a full vertex copy for each animation keyframe (and LOD level if you dare) and upload them in a single VBO. You can then use the vertex pointer to select keyframe to render. Since you would only have a limited amount of human models you can reuse for each pedestrian, you shouldn’t have problems with card memory.

I understand, so it’s better to avoid the use of the skeletal tecnique and it’s better to focus on the key framing tecnique. Do you have any relevant book or article regarding keyframing and VBO that a beginner like me have to read?

@cylab,
would you be able to interpolate between the key frames with the method you used efficiently?

If it can’t be done, then that’s something to consider as well since your animations could potentially be choppy.

Also, how much overhead is there for doing skeletal animation on the graphics card? Admittedly setting bones transforms for each of the 1000 humans could be a little expensive for this application, but generally does it still perform well?

Put the vertices of 2 frames in the geometry (like 2 TEXCOORD 3D attributes)

Build a vertex-shader that lerps between them. When you reach the end of the lerp, replace the VA/VBO.

With this technique, I got ‘animation’ basicly for free - ALL geometry could be animated, without a significant performance drop.
You pay for it in I/O (for VAs) or vRAM (for VBOs) though.