glUniform1f need to be called every time?

On my current hardware if I set variables with glUniform1f once, then disable the shader and re-enable it elsewhere in the drawing loop the settings are still there. My question is if this is standard use or should I set the variables again when I change shaders?

Uniforms are stored within their program objects. Much like textures are stored in texture objects. So you only need to reset a particular uniform within a program if you want to change the current value.

Usually when one use an uniform variable wants to change its value at least every rendering call, thats why you are going to see uniforms being set every time. If one does not want to change its value, it will be possibly be stored as a constant. Obviously that, in certain cases you do not want to change the uniform every time, but I think that it is the most common.

Ok thanks for the help. I have a uniform that needs to be set at the beginning of the loop however I need to turn it on and off a few times during rendering for objects that don’t need it and are in between depth.