This question comes in two (mostly) independent parts
My current setup is that I have a lot of Object
s in gamespace. Each has a VBO assigned to it, which holds Vertex Attribute data for each vertex. If the Object
wants to change its vertex data (position etc) it does so in an internal array and then call glBufferSubDataARB
to update the version in the GPU.
Now I understand that this is a horrible thing to do and so I am looking for alternatives. One that presents itself is to have some managing thing that has a large VBO in the beginning and Object
s can request space from it, and edit points in it. This drops the overhead of loading VBOs but comes with a large energy/time expenditure in creating and debugging such a beast (basically an entire memory management system).
My question (part (a)) is if this is the "best" method for doing this, or if there is something better that I have not thought of.
Such a system should allow easy addition/removal of vertices and editing them, as fast as possible.
Part (b) is about some simple actions taken on every object, ie those of rotation and translation. At the moment I am moving each vertex (ouch), but this must have a better option. I am considering uploading rotation and translation matrices to my shader to do there. This seems fine, but I am slightly worried about the overhead of changing uniform
variables. Would it ultimately be to my advantage to do this? How fast is changing uniform
variables?