Move matrix calculation to renderer.