Update camera uniforms only when really necessary

This saves redundantly setting some uniforms when changing materials that
share the same program, reducing CPU usage. This can give a significant
performance boost on devices which have a higher-performance GPU compared
to the CPU, such as Tegra K1.