I am trying to draw a 3D mesh, which is drawed within two for instructions (x, and y axis), when I draw it with plain openGL I get a framerate of 160fps, when I use MSAShape3D, which is supposed to be faster, I get around 50 fps rate.
I have tried calling the myObject.end() function after each inner loop (drawing line by line) or creating and array of MSA::Shape3D objects, and calling end after the outer loop…however I always get very bad results.
I see no real difference with the examples I’ve seen but using an array of Shape3D objects.
I have a similar experience, if I draw using glNormal3f() and glVertex3f() I get 60fps but I change it to MSAShape3D.setNormal() and addVertex() the frame rate drops to 30, I also realise when I quit the app I get the following error messages in the console:
MetaBalls(1067,0xa0708540) malloc: *** error for object 0x10e9c00: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
It always happens, I post and soon after I fix the problem.
So I manage to improve the performace by reading this post http://forum.openframeworks.cc/t/ofxmsashape3d/1898/4 there Memo explains how to get better performance out the class, I quote “if safe mode is off, it runs faster, but you better know exactly what states are on or off, and how you want them!”