Could someone explain to me what the various matrices are acting on? I'm having a hard time understanding what they do and how you apply them, because I can't visualise them. I know that since they're 4x4, they've got to be acting on a 4xn, probably a 4x1, matrix/vector. What I don't understand is what they are acting on, and what each of the indices in the matrices are. How do they fit into the data->what you see conversion, basically?
I think this lack of understanding is preventing me from getting any further with this, and I can't find any decent explanations online.
Haven't seen the code you're referring to, but I've written a 3d engine before (OpenGL, not Direct3D, but the math is the same), so I can make an educated guess: they're to be multiplied with existing matrices.
Usually a 4x4 matrix is a rotation matrix, to be multiplied with a vector (to get a position in worldspace) or multiplied with another rotation matrix (to get a cumulative rotation; animation, translation from worldspace to screenspace, multiple forces in physics engine, etc).
Another possibility, since you're working with pixel shaders, is deformation matrices to be applied to the framebuffer - I've seen 4x4 deformation matrices in Photoshop and GIMP plugins, but I never looked into them enough to figure out exactly what they were doing.