Optimising 3d objects for use in QC

monobrau's picture

Hi all!

I'm hoping to get some tips for the development of a game installation involving intensive use of 3d models. I've never worked very much with 3d/kineme3d in QC so here goes:

  • What's the best format to use, considering fast loading speeds and the use of multiple models at the same time?
  • Is md2 the only format supporting model animation (trough blending)?
  • Is animating a model trough an md2 model/blending the best way, or would it be better to import each individual element (arms etc.) and animate these within QC, considering CPU/GPU loads?

The 3d objects are made by another 3d artist, are there any rules or specific things he should stick to? I've browsed around the forum and read that for animating objects there should be the same number of faces/vertex in every object. Are there more things to consider that would make it easier for me to import the models with textures in QC?

Thanks!

Scratchpole's picture
Re: Optimising 3d objects for use in QC

Ok, I'm no expert but I'll try and answer to the best of my knowledge :)

  1. I have found FBX as a good, stable and fast model format with K3D.
  2. I have never built an md2 model but it contains a structure of models within the same container which can then be animated: see v002 model loader and example composition.
  3. It depends what you are trying to achieve. Separate models are difficult to animate as a whole, e.g. no joints.

Correct: in order to use the model blending patches you must have exactly the same number of vertex.

Have you considered using the built in mesh patches? I have only just begun to use them so others may be able to offer advice on what is possible...can the dae format contain a structure of models like an md2? Looking at the mesh renderer now: there is no image input for textures...so I'm guessing the dae format may contain the texture built in. Hope someone can confirm. Thanks.

dust's picture
Re: Optimising 3d objects for use in QC

i have not tried the new the latest kineme 3D tools yet, but from previous testing i can answer some of your questions. a lot of this is subjective i suppose as there are a ton of 3D modeling apps that artist uses, each with its own exporters.

Quote:
What's the best format to use, considering fast loading speeds and the use of multiple models at the same time?

• in general it seems the data exchange format (dae) seems to becoming the new standard. apple has introduced a whole new rendering pipe line and frame work called scene kit that designed to be used with the data exchange format. this format was chosen particularly because it would make it much easier for developers and artists to work together. scene kit really has nothing to do with k3D but k3D will load dae files.

• for loading multiple mesh's inside one model the DAE format is good. however i do know that k3D is optimized for FBX and the new version reflects some changes with FBX so more than likely FBX should be your first choice with K3D. this should be an easy export / save for your artist as well.

Quote:
Is md2 the only format supporting model animation (trough blending)?

• yes and no. FBX and DAE etc... support blending with an equal amount of vertices but MD2 seems to support a frame by frame type of animation in qc. this may help exporting animations from maya to MD2 https://github.com/arifken/MD2Export

Quote:
Is animating a model trough an md2 model/blending the best way, or would it be better to import each individual element (arms etc.) and animate these within QC, considering CPU/GPU loads?

• importing each element as an individual K3D object is defiantly not the way to go ? it would get messy real quick plus K3D lets you import multiple mesh's inside one model.

gtoledo3's picture
Re: Optimising 3d objects for use in QC

monobrau wrote:

  • What's the best format to use, considering fast loading speeds and the use of multiple models at the same time?

There are three popular ways to load 3D models in QC.

-Kineme3D - The plus of this is that there are built in "deformers", and support for "animated" md2 models. It used to be that Kineme used the autodesk SDK, which lent itself towards using FBX files for maximum compatibility and efficiency, while the md2 loader was a separate thing written by cwright. Now it uses a different SDK for loading - I think the same as the v002 model loader, but retains cwright's md2 loading portion, afaik.

The deforms are CPU based, which lends itself to great cross compatibility, but not as blazing speed as when a deform is done on a well supported GPU with GLSL or OpenCL.

K3D also has some support for parametric meshes, which is nice.

-v002 model loader - This supports a few more animated formats like md5, and some motion capture types. It has no built in "deformers", but this could be achieved with GLSL shaders.

-Apple QCMesh. This is pretty flaky and inconsistent in it's performance across various OS versions and GPU's. The plus is that it's built in, and on a machine that does OpenCL well, it's possible to write really fast mesh deformers. It has the plus of loading textures "automagically", but that's a negative is you need to do anything with the texture. It supports no animation.

As an aside, some types of models that are "frame by frame" animated in a style like md2's (md5's come to mind, and some dae's I've seen, I believe) can be converted to md2 via Blender (free). I've done this a number of times, and it works fine.

It's possible to build mesh from scratch with javascript, openCL or third party plugins, so that's "nice".

It also seems like maybe loading of files is more efficient but I hesitate to say that definitively.

monobrau wrote:

  • Is md2 the only format supporting model animation (trough blending)?

No, the v002 model loader will load and animate md5's that are animated, and a few other types, as previously mentioned. Check the notes on the plugin for more info.

monobrau wrote:

  • Is animating a model trough an md2 model/blending the best way, or would it be better to import each individual element (arms etc.) and animate these within QC, considering CPU/GPU loads?

It just depends on what you need to do, and the polycount of your model. Generally, md2 with k3d, or the v002 model animation stuff is solid and performs well, but view it like a "3d model flipbook". You're just selecting ranges of poses. If you design your own md2's it's not super hard to emulate complex movement, but it's finicky.

If you design an efficient, low poly model, it's totally reasonable to break off the pieces and animate using the k3D translate/rotate patches. However, because there is not an "origin" for rotation, it can be hard, and sometimes require not using the built in k3D translate/rotate patches, but a 3D transform. (This reminds me, I think I mentioned the idea of an origin offset on the k3D rotate a looooong time ago - it would allow one to do many more things in an easier way - at least when one wishes to make a model that moves according to skeletal movement.)

It would also be nice if k3D would implement asynchronous loading so that QC doesn't beachball while waiting for resources to load - I remember talking to cwright about this eons ago, and he thought it reasonable/possible.

monobrau's picture
Re: Optimising 3d objects for use in QC

Thanks guys,

That's all really helpful information!