As I stated before, I created an rbody plugin that allows me to just load up
individual rbody files.  I did this so I can load up individual models,
instead of creating them all at once in the char plugin.  It occurs to me,
though, that maybe this causes performance to be worse.  Maybe the char
plugin finds a way to optimize performance by managing all the vertices in
one location?

Hmm, well. My osgCal based stuff manages all the vertices in one
location. After cal3d core model is loaded from cal3d.cfg file, cal3d
hardware model is created and it `loads' the model into the vertex,
normal, index, weight, matrix index & tex coord buffers. After this
tangent & binormal buffers calculated (cal3d doesn't do it properly)
and we get several buffers for the whole model (BTW, these buffers can
be cached in external file to speed up model load times).

When we get these buffers all the cal3d do is blending animations &
return bone positions. We send then bone rotation matrices &
translation vectors to the shader and get deformed mesh. For picking &
correct bounding boxes vertex positions (w/o normals) is also
calculated on CPU.

About performance. You can remove vertex position calculation on CPU
(in exchange to some artefacts), also you can remove per-pixel
lighting from shader (no fill rate problems)
and then I think you can get lighting fast model rendering.

Also about performance. Our models (for which my osgCal is used) are
pretty hi-poly. So there are some tweaking to calculate as small as
possible. On model loading for each mesh is determined is it rigid
(moving only, not deforming) and then osg::MatrixTransform & static
shader used. If mesh not rigid maximum influencing bones per vertex
are found (usually not many meshes has vertices which are blended
between 4 bones) and then shader is used which only calculates the
necessary number of bone influences (the same is done for CPU
calculation, though, conditionals are not so slow here as in shaders).
Different vertex shaders for different max per-vertex bones count are
used because all loops are unrolled & ifs removed. Also to minimize
fill rate problems there are different fragment shaders used depending
on material (texturing or not, shining or not, normal mapped or not,
transparent or not, and combinations).

If so, I'll start looking at using the char plugin instead.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to