fmx wrote:Maybe we should have asked you earlier: what are you system specs
I guess it's somewere up there but I'm programming on my notebook VAIO VGN-SZ460N (its 2GHz core 2 Duo CPU with Intel integrated i945GM) I may use Nvidia graph card too but I'm saving power
[Linux Mint 12]
Ok hope I've finished development of JointMesh so I'll show you tests sources and I'll do only bugfixes... (it's still not so much tested so there may be a lot of bugs but..
)
Ok I've made a testing code and I used static optimized (nondebug) library "make -j 5 NDEBUG=1" - to see final use speed an memory consumption results..
I was really trying to make much less synthetic test (unfortunately I'm still missing non-skinned model).
I've created 5 instaces of one mesh (normal ninja stored in media directory)
Every model got different animation and some different speed of animation.
I used "video::EDT_NULL" as driver to remove rending overhead...
Code: Select all
scene::IAnimatedMesh* ninja = smgr->getMesh("../../media/ninja.b3d");
//normal walk
scene::IAnimatedMeshSceneNode* ninja1 = smgr->addAnimatedMeshSceneNode(ninja);
if (ninja1)
{
ninja1->setMaterialFlag(video::EMF_LIGHTING, false);
ninja1->setPosition(core::vector3df(0,5,40));
ninja1->setFrameLoop(0, 13);
ninja1->setAnimationSpeed(15);
ninja1->setScale(core::vector3df(2.f,2.f,2.f));
ninja1->setRotation(core::vector3df(0,-90,0));
}
//stealth walk
scene::IAnimatedMeshSceneNode* ninja2 = smgr->addAnimatedMeshSceneNode(ninja);
if (ninja2)
{
ninja2->setMaterialFlag(video::EMF_LIGHTING, false);
ninja2->setPosition(core::vector3df(10,5,45));
ninja2->setFrameLoop(14, 29);
ninja2->setAnimationSpeed(15);
ninja2->setScale(core::vector3df(2.f,2.f,2.f));
ninja2->setRotation(core::vector3df(0,-90,0));
}
//Idle 1
scene::IAnimatedMeshSceneNode* ninja3 = smgr->addAnimatedMeshSceneNode(ninja);
if (ninja3)
{
ninja3->setMaterialFlag(video::EMF_LIGHTING, false);
ninja3->setPosition(core::vector3df(-20,-5,35));
ninja3->setFrameLoop(183, 204);
ninja3->setAnimationSpeed(10);
ninja3->setScale(core::vector3df(2.f,2.f,2.f));
ninja3->setRotation(core::vector3df(0,-90,0));
}
//backflip
scene::IAnimatedMeshSceneNode* ninja4 = smgr->addAnimatedMeshSceneNode(ninja);
if (ninja4)
{
ninja4->setMaterialFlag(video::EMF_LIGHTING, false);
ninja4->setPosition(core::vector3df(20,-5,35));
ninja4->setFrameLoop(145,157);
ninja4->setAnimationSpeed(15);
ninja4->setScale(core::vector3df(2.f,2.f,2.f));
ninja4->setRotation(core::vector3df(0,-90,0));
}
const u32 now = device->getTimer()->getTime();
double FPSsum = 0;
u32 uFPSCount;
while (device->run() && (device->getTimer()->getTime() - now) < 10000 )
{
driver->beginScene(true, true, video::SColor(255,113,113,133) );
smgr->drawAll(); // draw the 3d scene
//device->getGUIEnvironment()->drawAll(); // draw the gui environment (the logo)
driver->endScene();
int fps = driver->getFPS();
FPSsum += fps;
uFPSCount++;
}
device->drop();
printf("Average FPS %f\n", FPSsum/uFPSCount);
It runs precisely 10 seconds and resulting average fps is affected mostly by animation of models (but not only by that)
I've made changes in CAnimatedMeshSceneNode to support context so the first test is
JointMesh (with context):
Average FPS 2340.633114
Average FPS 2348.469008
Average FPS 2343.881827
For next test I've removed usage of context inside "CAnimatedMeshSceneNode" so it's still CJointMesh but using less memory
not remembering last state should slow it a bit
:
Average FPS 2305.463757
Average FPS 2285.555399
Average FPS 2299.062877
To compare it with skinned mesh I've used normal CB3D loader to load data to skin mesh:
So skin mesh results (current solution) are:
Average FPS 2172.909205
Average FPS 2166.693414
Average FPS 2182.192176
I could use valgrind - memcheck to see how the memory was going...
JointMesh (normal with context):
==20915== HEAP SUMMARY:
==20915== in use at exit: 0 bytes in 0 blocks
==20915== total heap usage: 2,887 allocs, 2,887 frees, 1,590,421 bytes allocated
==20915==
==20915== All heap blocks were freed -- no leaks are possible
SkinMesh:
==23037== HEAP SUMMARY:
==23037== in use at exit: 0 bytes in 0 blocks
==23037== total heap usage: 2,702 allocs, 2,702 frees, 1,541,124 bytes allocated
==23037==
==23037== All heap blocks were freed -- no leaks are possible
Joint mesh allocate a bit more memory if that would be bottleneck it could be a bit optimized and memory consumption lowered it depends on a lot of conditions however the consumption is about 50k more on 5 models -> 10k per model. There is used different model loader that may consume a bit more memory too so it might not consume all this memory at runtime but during load time.
Ofcourse removing context competely would allow lower consumtion, but using context is necessary to support animation transitions.
So I guess you want to see files now so
http://www.mediafire.com/?shkh91tlvgylcr1 or directly
http://www.mediafire.com/file/shkh91tlv ... oints3.zip
I've added all files that are "changed a lot" - files with minor changes can be found in previous post in diff containing all changes. Theese files are modified ones from current trunk 1.8.SVN
And as for HW skinnig as I worte be4 it's not currently possible since irrlicht does not support something called attributes (well I'm not so sure about that but if it does explain me how
). Attribute is the value connected with each vertex (in this case weight and matrix pointer) so it's not possible to add skinnig without some ugly dirty hacks in drivers that I don't wana do.