Reputation: 2011
I want to know your thoughts regarding where matrix multiplication should be processed, where to store the results and general communication between the CPU and GPU.
Since the MVP matrix is the same for each object, calculating it on the CPU and then send it to the shaders seems like the way to go, yes?
If I have multiple shaders and some only need to model matrix, some need only the MVP matrix and some need both. How should I proceed?
I currently have a shader object for each vertex/fragment shader pair that stores the location of each uniform in the shaders. This seems like a good practise, yes?
Upvotes: 0
Views: 302
Reputation: 343
More generally when grappling with performance questions like these your best bet is to use a profiler (something graphics specific like GPUPerfStudio would be good for this sort of problem) and find out which method is faster in your specific case, as many performance tweaks have varying degrees of usefulness depending on the more specific scenarios.
Upvotes: 1