zone a test

This commit is contained in:
micuat 2020-11-06 16:29:21 +01:00
parent 3fa069be04
commit 2cf5b8ef6b
2 changed files with 7 additions and 2 deletions

View file

@ -9,6 +9,7 @@ uniform sampler2DRect u_energy;
uniform sampler2DRect u_v4l2cam;
uniform sampler2DRect u_buffer0;
uniform sampler2DRect u_buffer1;
uniform sampler2DRect u_gradient;
uniform bool u_calib;
uniform vec2 u_calibXY;
@ -166,9 +167,12 @@ void main() {
depth.r *= 100;
depth.a = 0;
// vec4 v4l2 = texture(u_v4l2cam, st);
vec4 v4l2 = texture(u_v4l2cam, (st + vec2(300, 0)) / 3.5 + vec2(-10, 86));
vec4 v4l2 = texture(u_v4l2cam, (st + vec2(300, 0)) / vec2(3.7,3.5) + vec2(4, 86));
v4l2 = texture(u_gradient, vec2(v4l2.r * 3425, 0));
gl_FragColor = depth + v4l2;
gl_FragColor = mix(vec4(v4l2.rgb,1), vec4(texture(u_color, st + vec2(300, 0)).rgb, 1), u_mouse.x/u_resolution.x);
float fader = sin(u_time * 3.1415 / 10);
fader = fader * 0.5 + 0.5;
gl_FragColor = mix(vec4(v4l2.rgb,1), vec4(texture(u_color, st + vec2(300, 0)).rgb, 1), fader);
}
else {
vec4 pointCloudColor = texture(u_ofcam, st);

View file

@ -377,6 +377,7 @@ void ofApp::drawMain()
boundShader.setUniform1i("u_calib", calibMode == true ? 1 : 0);
boundShader.setUniform2f("u_calibXY", registrationXY);
boundShader.setUniform1f("u_calibScale", registrationScale);
boundShader.setUniformTexture("u_gradient", gradients.at("warm1"));
boundShader.setUniform1i("u_init", 1);
boundShader.render();
boundShader.setUniform1i("u_init", 0);