Just remember, your graphics card only has a limited number of "locations" to keep track of your variables. A float takes up the same number of locations (1) as a vector4. So if you end up making a complicated shader that requires lots of data to be passed around, you may want to bundle your float's into vector4's since then you will be able to pass 4 parameters around but still only take up one location.

Just a tip, if you call glGetUniformLocation every time you update your variable you run the risk of stalling your pipeline which heavily degrades performance.

I'd expect that drivers would store uniform locations locally rather than needing to round-trip to the GPU in order to get them. OpenGL uniform locations bear absolutely no relation to what's actually happening in hardware, after all, and drivers already need to do a job of translating them to actual GPU registers, so drivers already have a "uniform table" of some kind implemented.

The performance hit would be needing to do a string-based lookup on this table, which is not as bad but which should still be avoided; your advice to cache and reuse the location remains valid.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.

Just a tip, if you call glGetUniformLocation every time you update your variable you run the risk of stalling your pipeline which heavily degrades performance.

Given he said it changes "every frame", I assume that means it changes only once per frame. The penalty of that is probably minimal, especially since you'd be already waiting for the pipeline to finish in order to swap buffers.

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.