Index: explosion.vert
===================================================================
--- explosion.vert	(revision c5fb958b35bfbdd43d77150e4abdeb8fd0efa383)
+++ explosion.vert	(revision bebfd5cd05cf7583936a782fd0eff30f1b7fb53f)
@@ -4,11 +4,8 @@
 
 uniform mat4 view, proj;
-
-/*
+uniform mat4 model_mat;
 layout (std140) uniform models {
   mat4 model_mats[MAX_NUM_OBJECTS];
 };
-*/
-uniform mat4 model_mat;
 
 uniform float explosion_start_time;
Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision c5fb958b35bfbdd43d77150e4abdeb8fd0efa383)
+++ new-game.cpp	(revision bebfd5cd05cf7583936a782fd0eff30f1b7fb53f)
@@ -262,4 +262,5 @@
 
 SceneObject* objExplosion;
+SceneObject* objFirst; // TODO: Set this, probably in populateBuffers and wherever else is appropriate.
 
 /*
@@ -680,5 +681,5 @@
    GLuint explosion_start_time_loc = glGetUniformLocation(explosion_sp, "explosion_start_time");
    GLuint cur_time_loc = glGetUniformLocation(explosion_sp, "cur_time");
-   //GLuint explosion_sp_models_ub_index = glGetUniformBlockIndex(explosion_sp, "models");
+   GLuint explosion_sp_models_ub_index = glGetUniformBlockIndex(explosion_sp, "models");
 
 
@@ -716,9 +717,7 @@
 
 
-   /*
    glUseProgram(explosion_sp);
    glUniformBlockBinding(explosion_sp, explosion_sp_models_ub_index, ub_binding_point);
    glBindBufferRange(GL_UNIFORM_BUFFER, ub_binding_point, ubo, 0, GL_MAX_UNIFORM_BLOCK_SIZE);
-   */
 
 
@@ -926,4 +925,12 @@
 
                   glUniform1f(explosion_start_time_loc, (GLfloat)glfwGetTime());
+
+                  // generic code used to change a matrix in the ubo
+                  // we need to know the matrix of the first object in the ubo so we can save it and move it back
+                  // after the explosion is rendered
+                  // However, that should be done in the render loop, not here
+                  // Here, we are already saving the explosion model mat in objExplosion->model_mat, so that is all we need
+                  glBindBuffer(GL_UNIFORM_BUFFER, ubo);
+                  glBufferSubData(GL_UNIFORM_BUFFER, obj.ubo_offset * sizeof(mat4), sizeof(mat4), value_ptr(obj.model_mat));
                }
             }
