cost of rendering 'modular' entity models

Started by
3 comments, last by kauna 9 years, 6 months ago

Hi everyone.

I'm working on a problem where players can 'design' their player avatars by effectively choosing different limb models to be animated via skeletal animation type system. These limb models are not meant to be seamless. I'm curious as to whether or not there is any way I can draw these modular player models more efficiently without having to perform a draw call for each of these model pieces as well as submit a modelview matrix for each one. Each player model is comprised of 10 of these model pieces, which are extremely cheap as far as shaders and geometry is concerned.

Any ideas? Suggestions? One idea is to generate a VBO for each possible combination of pieces, but this just seems very extreme if I were to have 5 possible model types for each player model segment (5^10th = 9.7 million combinations).

EDIT: I am targeting OpenGL 3.3, just FYI

Advertisement
Taking your last idea: just generate one vbo on the fly with the limbs your player has chosen, rather than having 9.699999 million unused vbo's.

Taking your last idea: just generate one vbo on the fly with the limbs your player has chosen, rather than having 9.699999 million unused vbo's.
That.

Grab whatever the player selected, compose a single buffer that holds it. Done.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

Taking your last idea: just generate one vbo on the fly with the limbs your player has chosen, rather than having 9.699999 million unused vbo's.

I forgot to mention that this is a multiplayer game, but you're right. Duh, me, duh.

In general, use instancing, gather the required transformations (world matrix) of all the same kind of meshes to one buffer and draw all the same kind of meshes with one draw call - one draw call for one type of a mesh. You'll need to submit the view-projection matrix only once.

The system can also take care of different material options, you'll just need to sort the draw calls based on the model and then the material - one draw call per mesh with similar attributes.

This works with rigid meshes and with skinned meshes. The question is just the amount of parameters (ie. transform matrices).

Cheers!

This topic is closed to new replies.

Advertisement