more .X much more decrease FPS.

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

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!!! :D
Image
Espanol
Posts: 40
Joined: Sun Oct 22, 2006 3:28 am

Post by Espanol »

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!!! :D
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.
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 );
		}
	}
	*/
IS THIS RIGHT?

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]
drac_gd
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

Post by drac_gd »

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!!!
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 post

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.
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

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.
Espanol
Posts: 40
Joined: Sun Oct 22, 2006 3:28 am

Post by Espanol »

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.
Luke, I have loaded your modifiered model in to my game with current SVN version, but the result is the same FPS.

I am very fell for this solution. How can I do?
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

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.
Image
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

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.
Image
drac_gd
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

Post by drac_gd »

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.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by 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.
Image
drac_gd
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

Post by drac_gd »

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.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

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. :wink:

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! :D

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).
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

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 ).
Image
drac_gd
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

Post by drac_gd »

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
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

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 ).
Image
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

(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 :shock:

It your interested Espanol, I’ll send you the files.
Post Reply