title: Should Uniform Buffer Objects be used over glUniform when uniform block size is small?
body: <p>I've recently replaced all usage of <code>glUniform()</code> in my code to instead use Uniform Buffer Objects (UBO) to better organize my object rendering code.  However, my performance has sharply plummeted as the number of objects drawn increases (an object in my case is anything with it's own offset into a UBO; only one UBO is shared between everything that uses the same shader program).  </p>
  
  <p>I think this may be because my objects actually use very little uniform data, sometimes as little as one <code>vec4</code>, while a UBO requires each offset be in multiples of <code>GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT</code> which can be rather large.  </p>
  
  <p>I understood UBO to be a strict upgrade to using <code>glUniform()</code>, am I mistaken?  Should I have a <code>glUniform()</code> path for these simple objects, or is there a necessary step to using UBOs effectively with many different simple objects that I haven't taken?</p>
  
  <p>My scene is mostly quads, with very few objects using more than 4 verts, 6 indices.  Some of these quads have large uniform blocks while most have very simple ones, maybe one or two <code>vec4</code>.</p>
  
  <p>(For now, I've gotten around this problem by embedding this object data into the vertices, though it definitely <em>feels</em> wrong to do it this way.)</p>