Commit c4152da3 authored by Lky's avatar Lky

update for ofTwill, basis on two layers

parent 4305ca77
......@@ -260,30 +260,33 @@ void main()
vec3 color;
vec3 color_layer_1, color_layer_2;
if (texCoordVarying.y/panel_height < 0.3) {
color_layer_1 = ContrastSaturationBrightness(channel_1.rgb,1,1,1);
//color_layer_1 = mix(vec3(0,0,0),color_layer_1,main_opacity);
color_layer_2 = ContrastSaturationBrightness(channel_4.rgb,(opBC_ch1/2)+1,1,opBC_ch1/2);
color_layer_2 = mix(vec3(0,0,0),color_layer_2,opBC_ch1);
}
else if (texCoordVarying.y/panel_height < 0.6) {
color_layer_1 = ContrastSaturationBrightness(channel_2.rgb,1,1,1);
color_layer_2 = ContrastSaturationBrightness(channel_4.rgb,(opBC_ch2/2)+1,1,opBC_ch2/2);
color_layer_2 = mix(vec3(0,0,0),color_layer_2,opBC_ch2);
}
else {
color_layer_1 = ContrastSaturationBrightness(channel_3.rgb,1,1,1);
color_layer_1 = ContrastSaturationBrightness(channel_1.rgb,1,1,1);
color_layer_2 = ContrastSaturationBrightness(channel_2.rgb,1,1,1);
// // UNCOMMENT TO GET THE THREE PANELS + HAND
// if (texCoordVarying.y/panel_height < 0.3) {
//
// color_layer_1 = ContrastSaturationBrightness(channel_1.rgb,1,1,1);
// color_layer_2 = ContrastSaturationBrightness(channel_4.rgb,(opBC_ch1/2)+1,1,opBC_ch1/2);
// color_layer_2 = mix(vec3(0,0,0),color_layer_2,opBC_ch1);
//
// }
// else if (texCoordVarying.y/panel_height < 0.6) {
//
// color_layer_1 = ContrastSaturationBrightness(channel_2.rgb,1,1,1);
//
// color_layer_2 = ContrastSaturationBrightness(channel_4.rgb,(opBC_ch2/2)+1,1,opBC_ch2/2);
// color_layer_2 = mix(vec3(0,0,0),color_layer_2,opBC_ch2);
//
// }
// else {
//
// color_layer_1 = ContrastSaturationBrightness(channel_3.rgb,1,1,1);
//
// color_layer_2 = ContrastSaturationBrightness(channel_4.rgb,(opBC_ch3/2)+1,1,opBC_ch3/2);
// color_layer_2 = mix(vec3(0,0,0),color_layer_2,opBC_ch3);
// }
color_layer_2 = ContrastSaturationBrightness(channel_4.rgb,(opBC_ch3/2)+1,1,opBC_ch3/2);
color_layer_2 = mix(vec3(0,0,0),color_layer_2,opBC_ch3);
}
/*
1 - multiply a * b
......
......@@ -4,6 +4,8 @@
#define WRITE_INFO
#define REBOUNCE_DELAY_MS 10
#define MAIN_W 1440 //for hand 1080
#define MAIN_H 1080 //for hand 1500
static int prev_frame = 0;
static bool db = false;
......@@ -15,9 +17,10 @@ void ofApp::setup()
actual_frame = 0;
w = ofGetWidth(); h = ofGetHeight();
int main_w, main_h;
main_w = 1080;
main_h = 1500;
/*int MAIN_W, MAIN_H;
MAIN_W = 1080;
MAIN_H = 1500;*/
// 3-Panel Masks
panelWidth = 1080;// ofGetWidth();
......@@ -25,11 +28,11 @@ void ofApp::setup()
framerate = 60;
main_fbo.allocate(main_w, main_h, GL_RGB);
main_fbo.allocate(MAIN_W, MAIN_H, GL_RGB);
fbo_ch1.allocate(main_w, main_h, GL_RGB);
fbo_ch2.allocate(main_w, main_h, GL_RGB);
fbo_ch3.allocate(main_w, main_h, GL_RGB);
fbo_ch1.allocate(MAIN_W, MAIN_H, GL_RGB);
fbo_ch2.allocate(MAIN_W, MAIN_H, GL_RGB);
fbo_ch3.allocate(MAIN_W, MAIN_H, GL_RGB);
fbo_noise.allocate(1080, 1080, GL_RGB);
gray = new unsigned char[w*h];
grayTex.allocate(w,h,GL_LUMINANCE);
......@@ -99,9 +102,13 @@ void ofApp::setup()
// INIT HAP
ofSetVerticalSync(true);
string path = "rushes/hand.mov";
/*string path = "rushes/hand.mov";
string path2 = "rushes/hap.mov";
string background_path = "rushes/kasi.jpg";
*/
string path = "ofTwill/hap/[ofTwill]_ThemeCompressed.mov";
string path2 = "ofTwill/hap/[ofTwill]_ThemeCompressed.mov";
string background_path = "rushes/kasi.jpg";
hap_ch1.load(path);
hap_ch1.play();
......@@ -420,10 +427,16 @@ void ofApp::keyPressed(int key){
// Opacity Channels
case 'u':
opBC_ch1 += 0.1;
if (hap_ch1.isPlaying()) {
hap_ch1.stop();
}
else {
hap_ch1.play();
}
break;
case 'j':
opBC_ch1 -= 0.1;
speed_ch1 = -speed_ch1;
hap_ch1.setSpeed(-speed_ch1);
break;
case 'i':
opBC_ch2 += 0.1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment