Skinning & Vertex Buffers
by Tim Ryness · in Torque Game Engine Advanced · 07/08/2004 (10:37 pm) · 8 replies
I'm looking into why when I have a guy on the screen my fps goes from 200ish to 100ish, I have spent a lot of time in d3d land trying to get (software) skinning as fast as possible, not for this, for another engine. I wanted to look into the code on TSE to see if the VertexBuffers for skining is efficient, unless you are doing the skinning in the shader, in which case would be ideal, but I doubt that it is. I saw this in the code in GFXD3DVertexBuffer.cpp, was going to see what exactly is going on, might be able to speed this up dramatically, for what it's worth the guy only has like less than 4k faces, so I surely hope it's not a bottleneck with the polys. I have taken these types of hits before when experimenting with locking and updating.
case GFXBufferTypeDynamic:
AssertISV(false, "D3D doesn't support dynamic vertex buffers yet. Talk to BJG.");
// It does - BJG
break;
case GFXBufferTypeDynamic:
AssertISV(false, "D3D doesn't support dynamic vertex buffers yet. Talk to BJG.");
// It does - BJG
break;
About the author
#2
07/09/2004 (6:56 am)
Trust me it's not the drivers, but I do have Cat 4.6, have a Radeon (9800 pro), like I said it screams with no characters on the screen.
#3
The comment you found was from me, and basically reflects the unfinished nature of GFX - the D3D backend is not fully set up for dynamic vertex buffers yet, I would guess.
07/09/2004 (7:43 am)
The skinning involves uploading the skinned meshes every frame. There is a bit of a performance hit from this. :)The comment you found was from me, and basically reflects the unfinished nature of GFX - the D3D backend is not fully set up for dynamic vertex buffers yet, I would guess.
#4
07/09/2004 (8:40 am)
Does this involve re-creating the VB every frame? I have been trying to walk through and figure out exactly what's going on, but it seems as though you are the guy to ask. :)
#5
// expensive operation - optimize, nuke I don't care about characters & bumps for now
This comment is understated :) But thats ok, what I did do for now is comment it out made a new
TSSkinMesh::createVBIB() and took it off only on the skinned characters, since I don't care about bumps on them yet, now the framerate hit is far less. I spend some time poking around, adding the hooks for dynamic, of course I realize now that dynamic is pretty much what is already in there. But hey I'm better off now, helped me learned the engine some more, it's well done. Might consider switching to 32bit indices sometime though.
07/10/2004 (11:26 pm)
Well I figured out the huge speed hit was related to this function fillTextureSpaceInfo(tempVerts);// expensive operation - optimize, nuke I don't care about characters & bumps for now
This comment is understated :) But thats ok, what I did do for now is comment it out made a new
TSSkinMesh::createVBIB() and took it off only on the skinned characters, since I don't care about bumps on them yet, now the framerate hit is far less. I spend some time poking around, adding the hooks for dynamic, of course I realize now that dynamic is pretty much what is already in there. But hey I'm better off now, helped me learned the engine some more, it's well done. Might consider switching to 32bit indices sometime though.
#7
07/11/2004 (10:43 pm)
You know let me check I have placed my own guy out there. I have been trying to go through and get a feel for all those script files :) My other engine uses lua, but it's only a few scripts, so this is a bit overwhelming, it's in here, oh no it's not, oh wait it's over here no, oh wait thats right it's in here ;) It's a goose chase, but I'll get it handled, I suppose I don't actually have to use the scripts if I didn't want to, but I would give up a lot of functionality out of the gate, that I would have to replace, thats the reason I wanted to go with Torque. I'm also working in the FPS demo, I somewhat ported it over with some help from Xavier Amado(his resource), I got the sound working too, actually pretty easy. I really want to port over our particle system into torque it's more artist friendly. I guess thats all for now, let me throw in that orc, I'll be back.
#8
For the record, the comment reads:
// expensive operation - optimize
We really do care about characters and bumps ;)
07/12/2004 (1:53 pm)
Yeah, that function is evil and slow. The tangent space information stored in each vertex can be linearly interpolated along with the vertex position during the skinning. This needs to be done, it's in the project manager, we know about it, we'll get to it unless one of you gets to it first.For the record, the comment reads:
// expensive operation - optimize
We really do care about characters and bumps ;)
Torque Owner Stefan Lundmark