Created
June 4, 2014 20:00
-
-
Save companje/2395e3b955d9472cfc22 to your computer and use it in GitHub Desktop.
Good old 'alpha trail' with two FBO's in openFrameworks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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