Ponies & Light

ofxVboMeshInstanced

ofxVboMeshInstanced

Draw instanced vbo meshes with openFrameworks

Update

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:

examples/gl/vboMeshDrawInstancedExample

in your openFrameworks 0.8.0 installation directory. ofxVboMeshInstanced is deprecated. I’m keeping this page for reference.

Download

Here’s the source code: http://github.com/tgfrerer/ofxVboMeshInstanced

This includes an example project.

Motivation

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.

Example

The Example project is basically the source code for the boxes! sketch:

See also: boxes!

Note

Don’t forget that most of the interesting stuff happens in the shader files, which are in

	example/bin/data/shaders

Reference Video

Dependencies

  • ♥ openframeworks >= 0071
  • ofxGui (core addon)
  • ofxXmlSettings (core addon)

License

ofxVboMeshInstanced is released under the MIT License.

Contact:

Unit 3, 410 Hackney Road,
E2 7AP London, UK