Animation code bug
-
spooky_paul
- Posts: 16
- Joined: Sun Nov 26, 2006 5:12 pm
- Location: Romania
Animation code bug
I have read in a topic that due to a bug in the 1.3 version irrlicht animates each frame twice, dos giving an important performance drop.
my question is if it was fixed in the latest svn, and if not when will it be?
paul
my question is if it was fixed in the latest svn, and if not when will it be?
paul
yes, this is still a problem. the main problem is that you don't know the size of a mesh before skinning it and getting its bounding box. so the scene manager skins the mesh in the OnRegisterSceneNode to see if it should be rendered, then it skins it again later when it renders it.
most of the IAnimatedMesh types won't re-skin if it's building the last skinned frame (x doesn't), but that doesn't help if there are multiple nodes that use the same mesh on screen (every node is registered, then visible nodes are rendered)
Luke and I were discussing this the other day... perhaps IAnimatedMesh needs getMaximumBoundingBox or something, which could be checked to see if the mesh should be skinned. it could start off as the size of the static mesh, and then increase to hold bone positions plus the skinned mesh... or possibly just enclose a sphere with radius of the longest chain of bones, or just all the bone positions in known keyframes... or possibly have a bbox for each keyframe and interpolate.
all those sound better than what we have currently.
for a future irrlicht-specific format, the maximum size could be read from disk
the result of the box being too small would result in disappearing mesh ugliness, too large and we're skinning things that are off screen.. currently we're skinning them twice if on-screen and once if off screen, which is incredibly bad.
edit: as of revision 698, x meshes don't re-skin the mesh if the last skinned frame was requested to be skinned again. doesn't fix the main problem though.
most of the IAnimatedMesh types won't re-skin if it's building the last skinned frame (x doesn't), but that doesn't help if there are multiple nodes that use the same mesh on screen (every node is registered, then visible nodes are rendered)
Luke and I were discussing this the other day... perhaps IAnimatedMesh needs getMaximumBoundingBox or something, which could be checked to see if the mesh should be skinned. it could start off as the size of the static mesh, and then increase to hold bone positions plus the skinned mesh... or possibly just enclose a sphere with radius of the longest chain of bones, or just all the bone positions in known keyframes... or possibly have a bbox for each keyframe and interpolate.
all those sound better than what we have currently.
for a future irrlicht-specific format, the maximum size could be read from disk
the result of the box being too small would result in disappearing mesh ugliness, too large and we're skinning things that are off screen.. currently we're skinning them twice if on-screen and once if off screen, which is incredibly bad.
edit: as of revision 698, x meshes don't re-skin the mesh if the last skinned frame was requested to be skinned again. doesn't fix the main problem though.
Yeah. this bug really needs to get fixed.
the BoundingBox should be static in the mesh and the node after creation, so it's easy for the user to change the bounding box if there are any problems. and if they are doing anything special they can add their own code to update the box.
want do you think?
I think a using maximum BoundingBox method is the best.the result of the box being too small would result in disappearing mesh ugliness, too large and we're skinning things that are off screen
the BoundingBox should be static in the mesh and the node after creation, so it's easy for the user to change the bounding box if there are any problems. and if they are doing anything special they can add their own code to update the box.
want do you think?
yeah, but this doesn't help if there as more then one mesh.edit: as of revision 698, x meshes don't re-skin the mesh if the last skinned frame was requested to be skinned again. doesn't fix the main problem though.
-
spooky_paul
- Posts: 16
- Joined: Sun Nov 26, 2006 5:12 pm
- Location: Romania
this is really bad news, as in my project there are at a given moment as more as 10 characters, about 5k polys each, normal mapped, and the scene dynamic lit. the way irrlicht handles animated nodes is quite a big performance drawback, and this throws off getting @30fps on medium hardware
is there any news regarding 1.4? will this be fixed in the following release?
is there any news regarding 1.4? will this be fixed in the following release?
-
spooky_paul
- Posts: 16
- Joined: Sun Nov 26, 2006 5:12 pm
- Location: Romania
Niko always never advertised release dates before, that way nobody can be dissapointed if it doesn't happen when expected. I don't want to be the first one to break this tradition!
However, if you want to check out the source from svn and help find and/or fix bugs it might help towards not needing a 1.3.2 release
Here's a fix related to this topic-
CAnimatedMeshSceneNode.cpp lines 169-173
replace this with:
this will fix the double-skinning thing (doesnt fix it for many render targets though), but could cause bounding box problems with animated IAnimatedMesh types (static and animated x, ms3d, b3d, md2 and md3 meshes will have to be checked). does this fix your problem? if so which mesh type are you using?
However, if you want to check out the source from svn and help find and/or fix bugs it might help towards not needing a 1.3.2 release
Here's a fix related to this topic-
CAnimatedMeshSceneNode.cpp lines 169-173
Code: Select all
scene::IMesh *m = Mesh->getMesh(CurrentFrameNr, 255, StartFrame, EndFrame);
if ( m )
{
Box = m->getBoundingBox();
}
Code: Select all
Box = Mesh->getBoundingBox();
-
spooky_paul
- Posts: 16
- Joined: Sun Nov 26, 2006 5:12 pm
- Location: Romania