Jump to content
  • Advertisement
Sign in to follow this  
deftware

OpenGL cost of rendering 'modular' entity models

This topic is 1344 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

 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

Edited by radioteeth

Share this post


Link to post
Share on other sites
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.
That.

 

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!