Commit 8a1a2c39 authored by Lky's avatar Lky

linking shader

parent 8446f85f
......@@ -4,9 +4,10 @@
uniform sampler2DRect tex1;
uniform sampler2DRect tex2;
uniform sampler2DRect tex3;
uniform sampler2DRect mask_tex1;
uniform sampler2DRect mask_tex2;
uniform sampler2DRect mask_tex3;
uniform float sin_value;
uniform int panel_width;
uniform int panel_height;
in vec2 brightContrast;
in vec2 texCoordVarying;
......@@ -109,7 +110,7 @@ vec3 HSLToRGB(vec3 hsl)
*/
// For all settings: 1.0 = 100% 0.5=50% 1.5 = 150%
vec3 ContrastSaturationBrightness(vec3 color, float brt, float sat, float con)
vec3 ContrastSaturationBrightness(vec3 color, float con, float sat, float brt)
{
// Increase or decrease theese values to adjust r, g and b color channels seperately
const float AvgLumR = 0.5;
......@@ -128,14 +129,28 @@ vec3 ContrastSaturationBrightness(vec3 color, float brt, float sat, float con)
void main()
{
vec4 channel_1 = texture2DRect(tex1, texCoordVarying);
vec4 channel_2 = texture2DRect(tex2, texCoordVarying);
float r = channel_1.r;
float g = channel_1.g;
float b = channel_1.b;
vec3 color = ContrastSaturationBrightness(vec3(r,g,b),0.5,0,1);
vec4 channel_2 = texture2DRect(tex2, vec2(texCoordVarying.x,texCoordVarying.y));
vec4 channel_3 = texture2DRect(tex3, texCoordVarying);
float sin_val = sin_value;
vec3 mixed_colors = mix(channel_1.rgb,channel_3.rgb,.5);
//mixed_colors = mix(mixed_colors,channel_3.rgb,.5);
vec3 color;
if (texCoordVarying.y/panel_height < 0.3) {
color = ContrastSaturationBrightness(channel_1.rgb,1,1,1);//vec3(channel_1.r,channel_1.g,channel_1.b),0.5,0,1);
} else if (texCoordVarying.y/panel_height < 0.6) {
color = ContrastSaturationBrightness(channel_2.rgb,1,1,2);
} else {
color = ContrastSaturationBrightness(channel_3.rgb,1,1,1);
}
// note:: CSB goes from effect to negative (if mouseX from 1 to -1).
outputColor = vec4(channel_1.rgb,1); //channel_2.r);
outputColor = vec4(color,1); //channel_2.r);
}
\ No newline at end of file
......@@ -11,6 +11,10 @@ in vec2 texcoord;
out vec2 brightContrast;
out vec2 texCoordVarying;
out vec2 texCoord_ch1;
out vec2 texCoord_ch2;
out vec2 texCoord_ch3;
// this is coming from our C++ code
uniform float mouseX;
uniform float mouseY;
......
......@@ -4,8 +4,8 @@
int main( )
{
ofGLWindowSettings settings;
//settings.setSize(1024*2, 512*2);
settings.windowMode = OF_FULLSCREEN;// OF_WINDOW;
settings.setSize(4096, 2160);
settings.windowMode = OF_WINDOW; //OF_FULLSCREEN;//
settings.setGLVersion(4, 1);
ofCreateWindow(settings);
......
This diff is collapsed.
......@@ -46,7 +46,7 @@ public:
ofTexture grayTex;
ofPixels pixels;
unsigned char * gray;
ofFbo fbo_ch;
ofFbo main_fbo;
ofFbo fbo_ch1, fbo_ch2, fbo_ch3;
bool recording, playing_record;
int record_actual_frame;
......
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