@Louisa wrote:
Hello everyone, I am getting the annoying Pixels are not allocated nmessage in console screen (command screen). The code below is running, however nothing is drawing to the output folder. I have successfully managed to draw files to output folder before, not sure why not working now. Am I missing anything? It must be something small.
I tried fboAllocate and imageAllocate, and both at the same time too, in setup.
void ofApp::setup(){ shader.load("shaderVert.c", "shaderFrag.c"); int counter = 0; image.loadImage( "sunflower.png" ); image.allocate(image.getWidth(), image.getHeight(), OF_IMAGE_COLOR); //fbo.allocate(image.getWidth(), image.getHeight(), GL_RGBA); } //-------------------------------------------------------------- void ofApp::draw(){ fbo.begin(); ofClear(255, 255, 255, 0); ofEnableDepthTest(); shader.begin(); float time = ofGetElapsedTimef(); shader.setUniform1f("time", time); ofBackgroundGradient( ofColor( 255 ), ofColor( 128 ) ); ofSetColor( 255, 255, 255 ); image.draw( 0, 0 ); shader.end(); fbo.end(); fbo.draw( 0, 0 ); ofPixels pix; ofSaveImage(pix, "output/" + ofToString(counter) + ".png", OF_IMAGE_QUALITY_BEST); counter++; }
Posts: 4
Participants: 3