For my game engine, I would like to be able to load all of the matrices (i.e. mvp, model, etc.) once per frame to save a bit of time, and have a set of uniforms that any shader can access by using layout or binding or something similar. I was wondering if this would be possible or would I have to load them each for every shader?
1 Answer
\$\begingroup\$
\$\endgroup\$
Yes, you can put your uniforms in a Uniform Buffer Object. These uniforms can be shared between programs. https://www.khronos.org/opengl/wiki/Uniform_Buffer_Object