Multiplication for MVP matrices: Any benefits to doing so within the vertex shader?
- by Nick Wiggill
I'd like to understand under what circumstances (if any) it is worth doing MVP matrix multiplication inside a vertex shader.
The vertex shader is run once per vertex, and a single mesh typically contains many vertices. All MVP inputs remain the same for each vertex in the vertex batch relating to a given draw call (model). Surely then, you're always better off keeping the multiplications in the client code, such that you pass in the whole MVP precalculated as a uniform? (avoiding redundant ops between individual vertices)