Basically its this; I am drawing ~1000 ofTextures on screen, and that’s pretty fast.
My project requires the textures to be drawn in a parallelogram shape, so I built an ofMesh for each texture, updating it when required, and then drawing the mesh binding the appropriate texture before.
tex->bind();
mesh.draw();
tex->unbind();
But this really dropped my framerate. Looking into how ofTexture.draw() works, I saw a custom ofMesh is built in place for every draw() call, so I thought I should get a similar performance… So digging around, I ended up trying what happens inside ofTexture:
And it blows away mesh.draw() in terms of performance. How come? It’s not really a bug, but something is clearly off. Anyone getting this? This is in 0.8.4 release on OSX 10.9.
are you using 0.8.4 or current master? in any case ofMesh::draw is making an extra call to ofMesh::draw(polyMode) and then it checks that the mesh is not empty before calling renderer->draw so that might make things slightly slower. also what’s the difference between the 2 methods?
I just put a breakpoint on ofMesh(draw) and I see that in my ofMesh useColors and useNormals are true when they shouldn’t (I don’t add any colors or normals to the mesh); Its the only difference I can see?
the programmable renderer already doesn’t use push / pop attributes and instead just sets back the polygon mode according to the current fill style so we probably should just do that in the fixed pipeline renderer too.