Slower renderer? (ofGLProgrammableRenderer)

When using ofGLProgrammableRenderer::TYPE as the renderer, it seems drawing something is slower. Is this normal?

For example, setting the framerate to 30 and drawing 5,000 lines using ofLine() :
22fps @ general renderer
11fps @ ofGLProgrammableRenderer::TYPE


Do you get the same performance difference if you do:

		ofMesh mesh;
		mesh.setMode( OF_PRIMITIVE_LINES );
		for( int i = 0; i < 5000; i++ )
		    mesh.addVertex( ofVec3f(ofRandom(-5,5), ofRandom(-5,5), ofRandom(-5,5) ) );
		    mesh.addVertex( ofVec3f(ofRandom(-5,5), ofRandom(-5,5), ofRandom(-5,5) ) );

I use the programmable renderer all the time and performance isn’t an issue, but I am using it with custom shaders rather than the default one OF uses internally when you are drawing. The internal one has to account for all the different types of features you are using to draw and won’t be as quick as a custom shader doing only what you are looking to do.

If you are wanting to use the programmable renderer, chances are it’s because you want to use your own custom shaders and you won’t be using the built in one that much.


Using ofMesh, I got 30fps no matter what renderer I chose, even when I created over 10,000 lines!

The programmable renderer never caused any problems either for me. But this time, I had to draw so many lines and encountered this kind of problem.

Thanks a lot for your advice, Andreas. :wink: