Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision 7e106674c060e8d918013011c754ad9b0e79b951)
+++ new-game.cpp	(revision c55614aa8c698a1ffb2b855ca2f2bb1af19c4908)
@@ -609,4 +609,6 @@
       (Also, I bookmarked a great explanation of this under )
 
+      CHECK MY OpenGL BOOKMARK CALLED "Learn OpenGL: Advanced GLSL"
+
       No, you're misunderstanding how this works. UBO binding works exactly like texture object binding.
 
@@ -2099,62 +2101,10 @@
       smg->vboCapacity = shaderCounts[smg->shaderProgram] * 2;
 
-      AttribInfo* attrib;
-
-      if (modelGroupIt->first == TYPE_SHIP) {
-         attrib = &smg->attribs["vertex_position"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-
-         attrib = &smg->attribs["vertex_color"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-
-         attrib = &smg->attribs["vertex_normal"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-
-         attrib = &smg->attribs["ubo_index"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-      } else if (modelGroupIt->first == TYPE_ASTEROID) {
-         attrib = &smg->attribs["vertex_position"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-
-         attrib = &smg->attribs["vertex_color"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-
-         attrib = &smg->attribs["vertex_normal"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-
-         attrib = &smg->attribs["ubo_index"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-      } else if (modelGroupIt->first == TYPE_LASER) {
-         attrib = &smg->attribs["vertex_position"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-
-         attrib = &smg->attribs["vt"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-
-         attrib = &smg->attribs["ubo_index"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-      } else if (modelGroupIt->first == TYPE_EXPLOSION) {
-         attrib = &smg->attribs["v_i"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-
-         attrib = &smg->attribs["start_time"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
-
-         attrib = &smg->attribs["ubo_index"];
-         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
-         glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
+      map<string, AttribInfo>::iterator attrIt;
+      for (attrIt = smg->attribs.begin(); attrIt != smg->attribs.end(); attrIt++) {
+         if (attrIt->second.attribType != ATTRIB_UNIFORM) {
+            glBindBuffer(GL_ARRAY_BUFFER, attrIt->second.buffer);
+            glBufferData(GL_ARRAY_BUFFER, smg->vboCapacity * GLsizeof(attrIt->second.type) * attrIt->second.size, NULL, GL_DYNAMIC_DRAW);
+         }
       }
    }
