The way I see it is that there's 2 ways I can go about rendering them:
1) Each control has its own shader program and is completely responsible for rendering itself.
2) There is a main UI renderer class that holds on to a single shader program or a shader program for each type of element, and renders all elements at once in a single shader.
I'm leaning towards option 1 right because it just seems simpler from a programming perspective, but I'm concerned about performance. If there are 50+ UI elements on the screen, all of different types, this means 50+ active shader programs that my graphics API needs to keep track of, on top of the shader programs for each mesh. So my question to the forum, in your experience, which method makes the most sense? Is there another method I'm simply not seeing?
Thanks.
P.S. Don't try to talk me out of making my own UI engine, cause I'm doing it







