|2 posts found|
Zombie - Dead but still moving.
OP 5/24/13 1:14:25 AM#1
Clothing on MMO characters. How is it being done?
I know of four methods for gear / clothing on character models (game and/or CGI).
1. Painted skin - The character model is organized in material zones. Each zone has a default base texture. As gear changes, the engine overrides the base texture with a texture for the gear. For example the chest armor texture replaces base, so it looks like the character is wearing armor. This is strictly a 2D texture swap with no additional geometry other than character body.
2. Mount point gear models - The character model is rigged with mount points, for example at the shoulders. The engine loads a new mesh for the shoulder model mounted on the appropriate shoulder mount point. There may be texture overrides, or the shoulder might load with its own base texture. The shoulder model itself does not animate. Rather it remains on the shoulder mount point, which does include animation to move it with character movements.
3. Conforming clothing - As seen in Poser and similar consumer level CGI. Clothing is it's own mesh driving by skeleton rigging that is identical to that of the character mesh. The engine places character model at a given transform, orientation, and animation frame (pose). The engine then places the conforming clothing at the identical pose, making it look like the clothing is being "worn" by the character. Z-buffer filtering resolves visibility.
4. Mesh Hiding Clothing - Every character includes mesh for all clothing items in-game. These are typically huge as there are several pieces of clothing. Engine turns all the mesh hiding clothing "off" (not rendered), except that which is being worn at the moment. The worn clothing has textures applied based on the gear that is being represented. All clothing is rigged as part of the character an animates appropriately (some gear may also have rigging used only by that gear such as bones driving capes).
I've used painted and mount point gear in my own MMO work, and can spot it. From what I've seen of newer games, there is definitely more involved.
So... Fancy gear. How the heck are they doing it?
MSOTSG with PPE : Massively Single-player Online Task-driven Storyline Game with Purchasable Performance Enhancements *grin*
7/09/13 7:09:20 PM#2
Actually, most MMORPGs use a combination of 1 and 4.
Most of the work is done by simply changing the textures. They used to render each part of the body as a seperate mesh/group so they could be textured individually, but now many games generate the texture dynamically by layering images and saving that to a texture and rendering that. This is because by using only one mesh, you only need to make one draw call. When you have many characters on screen this will burn a ton of CPU when they initially load. This is why in games like WoW sometimes character meshes will load far before the textures do, and they appear white.
Some types of armor have protrusions (like skirts, shoulders, helmets, etc). These are stored as part of the character model as meshes/groups that are turned on and off dynamically. These meshes may even be baked into the main mesh at runtime and stored as one vertex buffer to require only one draw call. They all share the same texture with the main mesh.
So typically there are no seperate meshes to load for each armor peice nor do you cram it all into a single model, they just reuse the generic protrusions and rebake the texture and vertex buffer each time the armor changes.
For best performance, one mesh, one texture (well, if you have multitexturing only one set of textures), one draw call.
On #2, you have this a bit wrong. You can playback animations on the shoulder. Just render it like you would any other mesh. You would be required to write code to sync these two independent animations.
What I intend on using is more inline with #3 and #4. I'll have a naked character model and seperate models for each armor set. They all have the same bones and play back the same animations at the same time. I'll mix and match armor pieces by simply drawing all of the required models with the different mesh/groups turned on and off. This is actually easier to code but it requires more draw calls- one per each mesh.
Mesh/Group - the smallest unit in the model that contains the triangles and can be assigned a material/texture. Because this can be hidden or assigned different textures and materials, these typically require their own draw calls.
Draw Call- In Direct3D this is any call to Draw() that causes the provided vertex buffer to be rendered. In OpenGL this is usually DrawArrays() or DrawElements(). The only way to change textures, shaders, etc between any group of verticies if to render them seperately.