Original Post
Hi, right now I'm working on the design document for my next game, though its more a big paper on what to do how in the engine, not the game itself, but with respect on what the game will need from the engine to do. So now I've come to character animations - or any other objects that will require bone animations. Where to do the new vertex position calculations? Should I do it with a shader? Or should I do it on the CPU? I guess if only drawing was the issue, then the shader would, of course, be more efficient, right? Since matrix math is performed faster on the GPU (4 paralell operations), right? But what happens when collision detection comes into play? I heard a talk by John Carmack, where he said he was not doing bounding box collisions in D3, but colliding with the model itself. Is that the way to go? I guess so, if I want to have decals on the model itself, like the blood in D3. If so calculating the new vertex positions has to be done on the CPU. So maybe I should do all the calculations on the CPU? But a creature will not get shot at every frame, so I have come up with this solution: Calculate the new vertex position/tangent/bitangent & normal in the shader for rendering. And only when the creature geets shot at (a bullet collides with its bounding box, one that covers the whole model), calculate only the new vertex positions & do the collision detection. (Will do allmost double work, but only once per the frames it needs to be done.) So what I want to know - is this the way to go, or is there a better, more faster way, in terms of performance? Any opinions/experiences are welcome. Thank you. EDIT: damn, forgot one very important aspect :) What if i need to do some multipass rendering? Am i guaranteed to have a better performance by precalculating the positions/tangents/normals every frame & then just use them each pass? [Edited by - Bouga on December 25, 2004 8:40:38 AM]