diff options
| author | Tim Redfern <tim@getdrop.com> | 2017-10-19 07:39:51 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2017-10-19 07:39:51 +0100 |
| commit | a4b2c2a0c569f6732ead116f7cbc3dae0fc999a0 (patch) | |
| tree | 5ba644745817528e496f0b161d5f3edd784c08af /keyshade/src/ofApp.cpp | |
| parent | a3c99df80c201e56a32eb5fe650d45e9a9ccaee2 (diff) | |
basically it
Diffstat (limited to 'keyshade/src/ofApp.cpp')
| -rw-r--r-- | keyshade/src/ofApp.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/keyshade/src/ofApp.cpp b/keyshade/src/ofApp.cpp index 9adae87..588557a 100644 --- a/keyshade/src/ofApp.cpp +++ b/keyshade/src/ofApp.cpp @@ -4,7 +4,7 @@ void ofApp::setup(){ shader.load("shader"); backgroundImage.load("../../../gui/bin/data/funfair/IMG_2893.JPG"); - foregroundImage.load("../../../gui/bin/data/funfair/IMG_2894.JPG"); + foregroundImage.load("../../../gui/bin/data/funfair/IMG_2890.JPG"); maskFbo.allocate(ofGetWidth(), ofGetHeight()); @@ -14,8 +14,8 @@ void ofApp::setup(){ ofClear(0,0,0,255); maskFbo.end(); - keyMinDist=0.2f; - keyMaxDist=0.3f; + keyMinDist=0.1f; + keyMaxDist=0.2f; keyColour=ofColor(200,40,0); } @@ -34,7 +34,8 @@ void ofApp::draw(){ shader.begin(); shader.setUniform4f("keyColour",keyColour); shader.setUniform1f("keyMinDist",keyMinDist); - shader.setUniform4f("keyMaxDist",keyMaxDist); + shader.setUniform1f("keyMaxDist",keyMaxDist); + shader.setUniform1f("time",2.0f+sin(ofGetElapsedTimef())); shader.setUniformTexture("backgroundTex", backgroundImage.getTexture(), 1 ); shader.setUniformTexture("foregroundTex", foregroundImage.getTexture(), 2 ); @@ -65,9 +66,9 @@ void ofApp::mouseDragged(int x, int y, int button){ //-------------------------------------------------------------- void ofApp::mousePressed(int x, int y, int button){ - keyColour = backgroundImage.getColor( - x*(backgroundImage.getWidth()/ofGetWidth()), - y*(backgroundImage.getHeight()/ofGetHeight()) + keyColour = foregroundImage.getColor( + x*(foregroundImage.getWidth()/ofGetWidth()), + y*(foregroundImage.getHeight()/ofGetHeight()) ); } |
