Enhancing the video synthesizer project
Now, we will consider various ways of enhancing our video synthesizer and expanding its capabilities. If you don't want to improve it right now, feel free to skip this section and go to the next section that discusses books and other references to openFrameworks.
Speeding up the rendering
In Chapter 2, Creating Your First openFrameworks Project, and Chapter 3, Adding a GUI and Handling Keyboard Events, we considered drawing patterns made from geometric primitives. You would note that when the number of drawn primitives is high, the rendering frame rate becomes low. This is due to the fact that each primitive is drawn by sending a separate command to a video card.
To speed up the rendering, you need to rewrite the stripePattern
and matrixPattern
functions so that they use ofMesh
objects or ofVboMesh
classes to render primitives (instead of calling the ofRect()
and ofTriangle()
functions). These classes draw primitives in bulk using one command, and as...