I currently have my rendering set up like this
public void Render()
// Scale, Rotation and Position are
Matrix m = Matrix.Scale(Scale) *
Matrix.RotationX(Rotation.X * Calc.Rad) *
Matrix.RotationY(Rotation.Y * Calc.Rad) *
Matrix.RotationZ(Rotation.Z * Calc.Rad) *
Matrix.Translation(Position.X, Position.Y, Position.Z) * RotationMatrix;
// Push the matrix onto the stack - not using the GL Matrix stack
if(Texture != null)
// Uploads all uniforms and projection/view matrices
// Only upload texture data when it is given
if (texcrdBufferId > 0)
int tloc = GL.GetAttribLocation(shader.program, "TexCoord");
GL.VertexAttribPointer(tloc, 2, VertexAttribPointerType.Float, false, 0, 0);
int vloc = GL.GetAttribLocation(shader.program, "Vertex");
GL.VertexAttribPointer(vloc, 3, VertexAttribPointerType.Float, false, 0, 0);
if (normalBufferId > 0)
int nloc = GL.GetAttribLocation(shader.program, "Normal");
GL.VertexAttribPointer(nloc, 3, VertexAttribPointerType.Float, false, 0, 0);
if (colorBufferId > 0)
int cloc = GL.GetAttribLocation(shader.program, "Color");
GL.VertexAttribPointer(cloc, 4, VertexAttribPointerType.Float, false, 0, 0);
GL.DrawElements(BeginMode.Triangles, indices.Length, DrawElementsType.UnsignedInt, IntPtr.Zero);
So basically every geometry i have is an instance of the model class, which is basically a vbo plus some usability methods.
If i am to draw say 1000 quads (if each being an instance of the same model with render called 1000 times), this Render method is executed every time. I see there is a lot of possible redundancy going on, but i'm not quite sure how to solve this problem, maybe with some kind of batch drawing.
The problems i have most with are the matrices/the stack, since they are different for each and every object.
What i read at another place was for particle systems it would be handy to store them all in one VBO, meaning storing all positions as attributes aswell, and have them dynamic or stream.
So what i take from this i could push more geometry into the vbo as i need it. but removing them accurately again would be quite a terrible act, and since i haven't worked in that regard with vbo's yet i can't say if that would even work.
Long story short, the problems are handling geometry and the corresponding information data (positioning/orientation/shaderdata) not for single instances but for mass drawing.