I have 170 objects for drawing, each of which is built from 312 vertices. I have one object, and I draw it 170 times with different Marxics, I realized that I do not need to call some functions if I draw them one by one, so I only call them at the beginning, it gives me about 5 frames per second, i am using non indexed triangles with drawArrays.
if(!started)
{
glUseProgram( __programObject );
glEnableVertexAttribArray(attPosition);
glVertexAttribPointer(attPosition, 3, GL_FLOAT, GL_FALSE, 3*sizeof(float), vVertices);
glEnableVertexAttribArray(attNormals);
glVertexAttribPointer(attNormals, 3, GL_FLOAT, GL_FALSE, 3*sizeof(float), vNormals);
}
Is there a way to make this faster in es 2.0? I get about 23 frames per second on sgx 540, reducing vertex detail to 36 per object does not increase the frame rate, in matrix calculations (scale, multiply, translate, translate, invert), about 10 frames per second, but they are made on the processor, and I don’t think moving them to shaders is a good idea. I know that most of the time is consumed when going through a uniform every time. I know that there is a way to create objects and transfer uniforms and draw them in one call, but I cannot find any tutorial describing it, do you know where I can find it?
source
share