#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup(){ ofEnableDepthTest(); ofSetFrameRate(60); // create a mesh ofBoxPrimitive box; box.set(5); mesh = box.getMesh(); instancingShader.load("DrawInstances"); // how many shapes nShapes = 300; // create matrix texture (16 elements per shape) // and color texture (4 elements per shape) matrixTexture.allocate(nShapes*4, 1, OF_IMAGE_COLOR_ALPHA); colorTexture.allocate(nShapes, 1, OF_IMAGE_COLOR_ALPHA); // create the colors /* "Some months ago the access to pixels raw pointer from an image changed from image.getPixels() to * image.getPixels().getData(). Please try that and let us know how if that was the problem." * - https://forum.openframeworks.cc/t/how-to-convert-unsigned-char-to-ofpixels--unsigned-char-correctly/27001/2 */ unsigned char * shapePix = colorTexture.getPixels().getData(); for(int i=0; i