My project I'm working on currently uses features such as Shadow mapping & Skeletal animation... and I'm using alot of OpenGL 4.X commands. I figure it's about time I move on with newer standards and start passing my own matrices to my GLSL shaders instead of using GL_MODELVIEW and such.. this works for situations in which I position my camera.. generate the matrix... upload to the GPU via a GLSL uniform and then draw my scene.

But what if i'm drawing particles or lots of objects moving about?

Usually I'd do something like:
for(Entity e: somelist)

{

glTranslate(e.x, e.y, e.z);
e.drawModel();

}

but How would I do this using opengl 4.X standards? Would I have to upload a new matrix before drawing every entity instance?

Yes, you would have to upload a new matrix, but that's just what a glTranslatef call does. The only difference is that instead of relying on an OpenGL call to calculate a translation matrix, multiply it by the current matrix, and upload that to the GPU, you get to do it all yourself.

It's worth noting here that glTranslatef and friends, despite being OpenGL calls, are not hardware accelerated (the OpenGL spec doesn't actually promise or guarantee that anything will be hardware accelerated). The GL matrix stack is just a software matrix library that calculates everything on the CPU and uploads the result to the GPU, so you can quite easily replace it with your own choice of software matrix library.

Edited by mhagain, 14 April 2014 - 11:06 AM.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.