
Originally Posted by
Ilian Dinev
Rob, that is great news! I missed it somehow. I'll try to create some 3.0 tutes once I get fluent.
Actually with my post I was over-exaggerating on how GL3.0 looks to me. Uniform-buffers are a great salvation, but they're not advertised correctly, imho. Having a buffer per instance is unpalatable. Instead, this should be possible/advertised:
bindable uniform SOME_STRUCT g_constants[1];
...
vec4 color2 = g_constants[InstanceConstID].color2;
// above InstanceConstID is a uniform or varying, and can have value = 777
Meanwhile, glUniform should be able to upload a whole struct, that contains only vec4/mat4, or an array of vec4.
In a perfect world, maybe there'd be a glCopyUniforms(...,UBO buf,int vec4offset,int vec4count). I've got many ideas/solutions (they're kind of obvious), but I don't know NDA-class details on current gpus to choose the best one to propose. I.e whether there's a cached range of constants in all gpus, or everything depends on general-purpose caches while loading constant-data dynamically.