more .X much more decrease FPS.
I've been playing with the .X loader and had many problems with it. I commented out the code that was trying to optimizeFrames and things were MUCH better. Try it, it's probably screwing up all your models.
I figured this out by trying to load the dwarf.x that comes with the DX SDK and it was actually crashing the engine. The optimizeFrames can't handle complex heirarchies of frames. I'm happy just leaving it commented out, not going to try and fix it. I don't think the engine should worry about optimizing the models, that's the 3D editor / artists job, not mine!!!
I figured this out by trying to load the dwarf.x that comes with the DX SDK and it was actually crashing the engine. The optimizeFrames can't handle complex heirarchies of frames. I'm happy just leaving it commented out, not going to try and fix it. I don't think the engine should worry about optimizing the models, that's the 3D editor / artists job, not mine!!!
Thank you Spintz, and would you please send your code files that can patch up for me. I am so confuse to look at irrlicht infrastructure loader code.Spintz wrote:I've been playing with the .X loader and had many problems with it. I commented out the code that was trying to optimizeFrames and things were MUCH better. Try it, it's probably screwing up all your models.
I figured this out by trying to load the dwarf.x that comes with the DX SDK and it was actually crashing the engine. The optimizeFrames can't handle complex heirarchies of frames. I'm happy just leaving it commented out, not going to try and fix it. I don't think the engine should worry about optimizing the models, that's the 3D editor / artists job, not mine!!!
I found it in CXFileReader.cpp but I am not sure that my comment out will not harm other part of engine.
Code: Select all
/*by espanol
m_bFrameRemoved = false;
for( u32Idx = 0; u32Idx < RootFrames.size(); u32Idx++ )
{
optimizeFrames( &RootFrames[ u32Idx ], 0 );
}
while( m_bFrameRemoved )
{
m_bFrameRemoved = false;
for( u32Idx = 0; u32Idx < RootFrames.size(); u32Idx++ )
{
optimizeFrames( &RootFrames[ u32Idx ], 0 );
}
}
*/
if that's right, it can't help anymore you can see the result from this picture
http://www.uppic.net/showpic.php?picid= ... 8b67ed42ae
and the bad effect is all of my model weapon which is link to its right hand biped was not at its hand but stay at 0,0,0 of the model body.[/url]
Today I checked out the latest svn version and built it and the examples. MeshViewer showed dwarf.x just fine but my model was messed up still. When I commented out the following in CXAnimationPlayer::addFacesToBuffer then everthing worked fine including dwarf.x and my model and Sword_Soldier_LV1.X from the previous postI figured this out by trying to load the dwarf.x that comes with the DX SDK and it was actually crashing the engine. The optimizeFrames can't handle complex heirarchies of frames. I'm happy just leaving it commented out, not going to try and fix it. I don't think the engine should worry about optimizing the models, that's the 3D editor / artists job, not mine!!!
Code: Select all
/* core::matrix4 mat = frame.LocalMatrix;
s32 vcnt = buf->Vertices.size();
for (s32 u=0; u<vcnt; ++u)
{
mat.transformVect(buf->Vertices[u].Pos);
mat.rotateVect(buf->Vertices[u].Normal);
} */
The soldier still had very low frame rate ( around 40fps )
BTW whoever added the optimizeFrame to svn THANK YOU THANK YOU THANK YOU.
The optimizeFrame code mainly helps if you exported a model with sub meshes using panda which inserts empty frames ( no mesh ) and identity matrix before each sub frame/mesh. The correct way to make irrlicht work correctly with this seems to be beyound my reach but optimizeFrame is a workaround.
IrrSpintz ,
does my hfa model work in your version without the optimizeFrame? If it does is it your IrrSpintz version? If it looks ok in your mesh viewer I believe I will revisit this issue.
Well, here's the mesh,
http://www.fileden.com/files/2006/8/10/ ... new%29.b3d
Make sure you are using the SVN as it is much faster,
I scaled the animation out to 1-2000, and the b3d loader will scale it again by 100, don't worry there is no overhead with this, and you should get smoother animations.
There are still a large number of keyframes in that mesh which you should try to cut down on.
http://www.fileden.com/files/2006/8/10/ ... new%29.b3d
Make sure you are using the SVN as it is much faster,
I scaled the animation out to 1-2000, and the b3d loader will scale it again by 100, don't worry there is no overhead with this, and you should get smoother animations.
There are still a large number of keyframes in that mesh which you should try to cut down on.
Luke, I have loaded your modifiered model in to my game with current SVN version, but the result is the same FPS.Luke wrote:Well, here's the mesh,
http://www.fileden.com/files/2006/8/10/ ... new%29.b3d
Make sure you are using the SVN as it is much faster,
I scaled the animation out to 1-2000, and the b3d loader will scale it again by 100, don't worry there is no overhead with this, and you should get smoother animations.
There are still a large number of keyframes in that mesh which you should try to cut down on.
I am very fell for this solution. How can I do?
drac, not the dwarf.x in the irrlicht media folder. The dwarf.x that comes with the DX SDK, it's in =
{DX Install Dir}\Samples\Media\Dwarf
I've been away a couple days, I'll check your mesh again in IrrSpintz with all the optimization code commented out( loading is much faster and I can only load the DX Dwarf.x with it commented out ).
EDIT: Just checked your mesh, the debug data can be seen, i.e. the skeleton and the bounding box, however, the mesh cannot be seen. Not sure what's wrong there.
{DX Install Dir}\Samples\Media\Dwarf
I've been away a couple days, I'll check your mesh again in IrrSpintz with all the optimization code commented out( loading is much faster and I can only load the DX Dwarf.x with it commented out ).
EDIT: Just checked your mesh, the debug data can be seen, i.e. the skeleton and the bounding box, however, the mesh cannot be seen. Not sure what's wrong there.
I found the problem in IrrSpintz with your mesh drac, well the reason no mesh data was showing up at all. It was because at some point, the matrix4::transformVect( const vector3df&, vector3df& ) function had the arguments swapped and I never integrated that change.
So anyway, now I have the same results in IrrSpintz as we do in Irrlicht. The problem is with the optimizeFrames function, there's a bug in it somewhere that's not applying the proper frame transformations, I'll keep looking into it.
So anyway, now I have the same results in IrrSpintz as we do in Irrlicht. The problem is with the optimizeFrames function, there's a bug in it somewhere that's not applying the proper frame transformations, I'll keep looking into it.
Thanks for looking at it.. Really the complex direct x meshes issues have existed for a long time. When I have tried to solve it I dont seam to get anywhere ( I am relatively new to 3d programming ). In any case my modified version of irrlicht seems to be ok but is such a mish mash of old irrlicht and pieced from the forum and my own mods etc that I am hesitant to have anyone look at it because it may not benifit the community.. If you want my current source/project I will send it to you if you think it might help.. My version seems to be ok with the models I use. So no need to spend alot of time on it.
Thanks again Spintz.
Thanks again Spintz.
Yes, I'd like it if you could email it to me, at least the 6 directx files -
CXAnimationPlayer[.h,.cpp]
CXFileReader[.h,.cpp]
CXMeshFileLoader[.h,.cpp]
IMO, .X meshes are the best meshes with the most flexibility and options. So, I would like to get all types of .X meshes working and will contribute my findings to the community.
CXAnimationPlayer[.h,.cpp]
CXFileReader[.h,.cpp]
CXMeshFileLoader[.h,.cpp]
IMO, .X meshes are the best meshes with the most flexibility and options. So, I would like to get all types of .X meshes working and will contribute my findings to the community.
Spintz,
I confirmed It wont load the dwarf that comes with directx even after uncompressing using MeshView:( The optimizeFrames hack only works for simple models and models exported by panda because it relies on the frame hierarchy being a certain way.. I really hope you can find and fix the issues.
here is my version of the files you specified.
http://www.tronacom.com/downloads/ForSpintz.rar
Thanks.
I confirmed It wont load the dwarf that comes with directx even after uncompressing using MeshView:( The optimizeFrames hack only works for simple models and models exported by panda because it relies on the frame hierarchy being a certain way.. I really hope you can find and fix the issues.
here is my version of the files you specified.
http://www.tronacom.com/downloads/ForSpintz.rar
Thanks.
It seems that something is broken in SVN for X files. I posted a bug report about an X file that loaded fine in Irrlicht 1.2 but didn't in the latest svn (the tiny.x from the DirectX SDK). Hopefully this will be fixed before the official 1.3 release.
I also tried the "mview.exe" trick, with no luck. Interestingly, I searched the forum for a link to mview.exe but they were all dead links. I went and searched my CD's and found that mview.exe is on the DX 9.0 SDK (the first DX9 SDK); not only that but the source code is on the CD too!
I'm also warming to the B3D format. I struggled for ages with the 3DS format castle model in my ReflectiveWater demo until I just used MilkShape to load in the 3ds and save as b3d - Irrlicht loaded it up first time and all the textures were OK (not completely black, like before).
I also tried the "mview.exe" trick, with no luck. Interestingly, I searched the forum for a link to mview.exe but they were all dead links. I went and searched my CD's and found that mview.exe is on the DX 9.0 SDK (the first DX9 SDK); not only that but the source code is on the CD too!
I'm also warming to the B3D format. I struggled for ages with the 3DS format castle model in my ReflectiveWater demo until I just used MilkShape to load in the 3ds and save as b3d - Irrlicht loaded it up first time and all the textures were OK (not completely black, like before).
Thank drac, I'll take a look at those files.
I am looking at the issues. I'm half tempted to use DX to load the .X meshes and then just get the data from the ID3DXBaseMesh interfaces, but that would make animation a real pain in the ass. Aside form the bugs that the .X loader has, it's missing support for TONS of features which make the .X file format so good. I'm working on them, among other things( DDS loading for example ).
I am looking at the issues. I'm half tempted to use DX to load the .X meshes and then just get the data from the ID3DXBaseMesh interfaces, but that would make animation a real pain in the ass. Aside form the bugs that the .X loader has, it's missing support for TONS of features which make the .X file format so good. I'm working on them, among other things( DDS loading for example ).
Thats great!!!
Umm somewhere I patched my irrlicht to load DDS.. I have no Idea if it actually works because I have no models with DDS. anyway here are the
dds files
http://www.tronacom.com/downloads/CImageLoaderDDS.h
http://www.tronacom.com/downloads/CImageLoaderDDS.cpp
Umm somewhere I patched my irrlicht to load DDS.. I have no Idea if it actually works because I have no models with DDS. anyway here are the
dds files
http://www.tronacom.com/downloads/CImageLoaderDDS.h
http://www.tronacom.com/downloads/CImageLoaderDDS.cpp
Thanks, I'll have a look at them. I actually already have DDS loading working, except for DXTn formats. I actually just today got the DXT1 decoding working for the 4x4 block, just need to expand it for the whole image. My DDS loader is most likely different as well, because it's capable of loading VOLUME dds formats, for loading 3d textures and will also support loading cubemap DDS formats as well( since IrrSpintz has support for those 3D and CubeMap textures ).
(Repeating this from another topic, but just to let you know)
I’ve been worked hard on the b3d animator.
I boasted the speed of the b3d animator in tests from 100fps to 512fps
It was already faster then x, in that test
It’s faster then ms3d now too, in a test 190fps (ms3d), 300fps(b3d)
This test was with 10 of psionic’s dwarf meshes, with the animation not caching.
It can handle large numbers of keyframes with less slow down too now.
I can handle 70 of your meshes at over 80 fps (on my 1.6GHz Centrino laptop) all on screen, all animating differently, no animation caching.
10 of your meshes runs at over 520fps now
It your interested Espanol, I’ll send you the files.
I’ve been worked hard on the b3d animator.
I boasted the speed of the b3d animator in tests from 100fps to 512fps
It was already faster then x, in that test
It’s faster then ms3d now too, in a test 190fps (ms3d), 300fps(b3d)
This test was with 10 of psionic’s dwarf meshes, with the animation not caching.
It can handle large numbers of keyframes with less slow down too now.
I can handle 70 of your meshes at over 80 fps (on my 1.6GHz Centrino laptop) all on screen, all animating differently, no animation caching.
10 of your meshes runs at over 520fps now
It your interested Espanol, I’ll send you the files.