I looked around/did a search and I didn't find another topic like this. Sorry in advance if I missed it.
I'm working on a new project where different types of characters can wear different clothes, tools, etc. I've done a project like this in 2D and it just required that I make new sprites, not a big deal. The new project is going to be in 3D (using XNA), so I was wondering:
1. Would it just be easier (though time consuming) to just create a new model for every different set of equipment (i.e. guy in fatigues, guy in plate armor, guy in t-shirt/jeans) ?
or
2. Would it be easier/more efficient to render the equipment onto my base character models based on their dimensions (i.e. breast plate is scaled based on model's width, depth, and height and placed with relative coordinates to the model's torso)?
I've done some work in 3D as far as hierarchal modeling that I believe might be the correct direction to go, but I'm not sure (this being my first 3D game).
I'm not asking for code or anything, just some psuedocode or a general direction will be tremendously helpful. I'm still quite a bit far away from actually rendering models to the screen, so its not that urgent. Really just curious.
Rendering items on a model
#2 as it is more flexible, and in the long run is quicker to add new features with less memory overhead.
If your characters are rigged, then you can just load multiple models and attach them all to the same skeleton instance. As long as the peices are designed to fit together, everything just works (e.g. if you do body shape scaling by affecting the skeleton, then it will affect the body model, the chestplate armour model, gauntlets model, etc)
If your characters are rigged, then you can just load multiple models and attach them all to the same skeleton instance. As long as the peices are designed to fit together, everything just works (e.g. if you do body shape scaling by affecting the skeleton, then it will affect the body model, the chestplate armour model, gauntlets model, etc)
from performance wise, it would allso be more efficent to bake the entire models into one vertexbuffer aswell as one texture atlas.
ea, one drawcall.
the way i would do it would be like this :
1 : find the models current itemset
2 : load the correct items, ea, right arm, left arm, torso, head, legs and more to it.
3 : combine the vertex & texture buffer
4 : unload all the data we dont need anymore (models and texture that we just combined)
5 : in the shader have input params controlling the length, size and other personal stuff about the charcter.
hope this would help. (btw, this way will work with animation aswell)
ea, one drawcall.
the way i would do it would be like this :
1 : find the models current itemset
2 : load the correct items, ea, right arm, left arm, torso, head, legs and more to it.
3 : combine the vertex & texture buffer
4 : unload all the data we dont need anymore (models and texture that we just combined)
5 : in the shader have input params controlling the length, size and other personal stuff about the charcter.
hope this would help. (btw, this way will work with animation aswell)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement