So I've been upgrading my engine to use custom view matrices instead of the OpenGL gl_ModelView and gl_Projection which are deprecated in newer versions.
Now, as I'm using Shadow mapping, Skeletal Animation, and various other shader techniques, I've split my matrices into:
modelMatrix
viewMatrix
modelViewMatrix
projectionMatrix
modelViewProjectionMatrix
So each time I translate() an object, or manipulate any of these matrices, all 5 are uploaded to my Uniform Buffer Object on the GPU.
And my FPS has dropped from 1200 to 170, this is unacceptable for me considering all I've done is change the matrices behind the scene. Nothing has changed in the engine itself.
Can someone tell me what has caused the drop in performance? I'm guessing it's something along the lines of:
- My matrix operations in Java are slow
- Uploading 5 matrices regularly is using up my bandwidth?