ofxVboMeshInstancedDraw instanced vbo meshes with openFrameworks
As of openFrameworks 0.8.0, instanced rendering of VBO meshes is part of the core. I’ve written an example for this functionality, which you can find in:
in your openFrameworks 0.8.0 installation directory. ofxVboMeshInstanced is deprecated. I’m keeping this page for reference.
Here’s the source code: http://github.com/tgfrerer/ofxVboMeshInstanced
This includes an example project.
Instanced rendering of vbo meshes allows you to offload an insane ammount of calculation to the GPU. Once vertex data is uploaded to a vbo, many instances of the mesh can be rendered incredibly fast. Using GLSL shaders, individual instances of the vbo mesh can be modified on the GPU. I demonstrate this technique in the example project.
This is specially useful for rendering grass or trees in 3d environments, but could also be put to use for more abstract artwork.
This addon helps drawing instanced openGL meshes with openFrameworks, and the enclosed example project demonstrates the technique with a GPU accelerated reaction-diffusion system.
The Example project is basically the source code for the boxes! sketch:
See also: boxes!
Don’t forget that most of the interesting stuff happens in the shader files, which are in
- ♥ openframeworks >= 0071
- ofxGui (core addon)
- ofxXmlSettings (core addon)
ofxVboMeshInstanced is released under the MIT License.