Hello.
I'm testing different OpenGL functionalities that I will eventually use for my game engine.
I read about glDraw*instanced and thought: "I need that!"
On my NVidia machine it works like a charm. I can draw as many objects as my array can hold in a single draw call with close to no performance impact.
However on Intel HD 2000/3000 with OpenGL 3.3 the performance for 768 triangles is 50ms.
Why? Am I doing something wrong that Intel doesn't like?
It surely can't be that Intel doesn't support instantiation...? I can play other games on this laptop just fine and they don't give me 50ms / frame.
If it really is unsupported, what are my options?
Draw function summary:
glBindBuffer(GL_ARRAY_BUFFER, pos);
glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_STREAM_DRAW); // Buffer orphaning
glBufferSubData(GL_ARRAY_BUFFER, 0, size, posData);
glUseProgram();
// Create matrices
// Uniform matrices
// These three lines for vertices, uvs, normals, position data
glEnableVertexAttribArray(vertID);
glBindBuffer(GL_ARRAY_BUFFER, vertBuf);
glVertexAttribPointer();
glBindBuffer(GL_ARRAY_BUFFER, indBuf); // bind indices
// This x4
glVertexAttribDivisorARB();
glDrawElementsInstancedARB(
GL_TRIANGLES, // mode
size, // count per instance
GL_UNSIGNED_INT, // type
(void*)0, // element array buffer offset
instances // total instances
);
// Unbind stuff
Edit: Declaring the streamed array "posData" as global seems to have positively effected the scenario above and went from drawing 10 triangles / frame to 100 000+
Edit2: I seem to have jumped the train too soon. What actually made the difference was setting the display mode to fullscreen.