Original Post
I'm reading a book on preprocessing models for a game, and I've got a question about one of the techniques described. The author suggests collapsing a model's hierarchy if two nodes are static relative to one another, to reduce the number of draw calls. This makes sense: if two nodes never move or always move together, there's no need for them to be two separate draw calls. Then he suggests that when creating a lower LOD version of the mesh, you may want to take things a step further, and merge nodes if they move separately, but you won't notice. For example, one might want to merge a characters upper arm and lower arm together. Even if they move separately, at a low LOD the player is not likely to notice. This makes sense too, but I get tripped on on the math of how to calculate if two nodes are "imperceptibly different." The book suggests calculating a "difference transformation" for every frame of animation. This is a matrix that maps from the space of one node to the space of another. So far so good. It then says that you should calculate the "maximum difference between these." This maximum difference is then compared to a threshold, and if it is less, the nodes can be merged. Logically, this makes sense. I'm trying to find the frame of animation where the two nodes are most different, and then check to see if that difference is less than my threshold. If so, I can merge them. So, apparently I'm meant to be calculating a scalar value from two matrices that represents how "different" the two are. How is this done? For example, one difference transformation might be a translation of (100,0,0), and another might be a translation of (0,100,0). I suppose "difference" could be the average distance between the unit x y and z vectors transformed through each of the two matrices. Or maybe the average "error" of each vert in the two nodes, were they merged together? I've read and reread the book, and it's still not clicking. Any suggestions?