Depends on which GL version you’re targeting. State access is basically deprecated in GL 3.0, but for earlier versions I think it’s the best way, since there’s a limited number of uniforms you can use.
guess it’s easier with glMatrixMode calls. don’t you need to pass or build f.e. a normal matrix inside the shader if passing via uniforms which is done automatically if using method 2? i guess this was implemented that way with something in mind.
why would you wanna drop it? gl_LightSource/gl_Material and the like are same reserved uniforms set via the gl calls. i use them like crazy maybe because of nostalgic OpenGL feeling, but yeah deprecated?
I really think that all these gl_LightSource, gl_Material, and matrices stuff just make this code more complex. Moreover nowdays with bindable uniforms, it becomes very inlikely to use those fixed pipeline stuff.