Hello ,i am currently working on a project on OpenGL. At the moment i have pretty solid scene that is loading a bunch of stuff like: Terrains,Models,Animated Models,SkyBox etc. The project is written on C++. Recently i tried to benchmark the project and i found out that loading uniforms can be quite expensive. Currently i am using one shader per structure type so:
- For Terrains i use1 shader (vertex + fragment)
- For Models i use 1 shader (vertex + fragment)
- Etc.

So for me to have multiple Models using one shader i have to reupload the uniform data + bind the vao for each model every frame before the model is rendered. But according to the benchmark the per-frame uniform loading takes about 40%~ of the time which is quite alot.

My Questions is: Should i use a different shader for each model and load the data that won't change to each shader ONCE before the main loop. Ofcourse there will be some special cases which can be handled when needed. Is this good practice, is this the way to go ?