Working on making an application with high levels of instancing (in webgl 1.0). I was hoping to utilize uniforms to some extremes but I noticed I hit a snag:
Whenever I switch programs I was noticing threejs does a LOT of recommitting uniforms
So, I guess I was curious to better learn my WebGL. Everything you google says an individual program has it’s own set of uniforms and when you swap programs the uniforms you uploaded for that program remains and should be ready to go for you.
However, what I see threejs doing seems to contradict that.
So, i’m hoping to clear this thought up once and for all: If you use all of the uniforms up to gl_max_vertex_uniform_vectors in each program and you have 10 programs. Do you have to re-upload the uniforms? Or is something else at play here that I may not understand?
Would it possibly be faster to just keep a single program mounted and rapid swap out the uniforms?
And for threejs understanding if I do a material.clone() does that generate an additional program down lower?