Skip to content

Instantly share code, notes, and snippets.

@companje
Created June 4, 2014 20:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save companje/2395e3b955d9472cfc22 to your computer and use it in GitHub Desktop.
Save companje/2395e3b955d9472cfc22 to your computer and use it in GitHub Desktop.
Good old 'alpha trail' with two FBO's in openFrameworks
#include "ofMain.h"
class ofApp : public ofBaseApp {
public:
ofShader shader;
ofFbo fbo1,fbo2;
void setup() {
ofBackground(0);
fbo1.allocate(ofGetWidth(),ofGetHeight());
fbo2.allocate(ofGetWidth(),ofGetHeight());
}
void update() {
fbo1.begin();
ofClear(0,0,0,20);
ofCircle(ofGetMouseX(), ofGetMouseY(), 20);
fbo1.end();
}
void draw() {
fbo2.begin();
fbo1.draw(0,0);
fbo2.end();
fbo2.draw(0,0);
}
};
int main( ){
ofSetupOpenGL(1024,768,OF_WINDOW);
ofRunApp(new ofApp());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment