From 3fa069be0418a513139262a92371a4574951ea62 Mon Sep 17 00:00:00 2001 From: micuat Date: Fri, 6 Nov 2020 16:00:40 +0100 Subject: [PATCH] testing color-thermo for filming --- zoneb/bin/data/shaders/bound.frag | 5 ++++- zoneb/src/ofApp.cpp | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/zoneb/bin/data/shaders/bound.frag b/zoneb/bin/data/shaders/bound.frag index 4051935..8de7a4d 100644 --- a/zoneb/bin/data/shaders/bound.frag +++ b/zoneb/bin/data/shaders/bound.frag @@ -3,6 +3,7 @@ precision mediump float; #endif uniform sampler2DRect u_depth; +uniform sampler2DRect u_color; uniform sampler2DRect u_ofcam; uniform sampler2DRect u_energy; uniform sampler2DRect u_v4l2cam; @@ -164,8 +165,10 @@ void main() { vec4 depth = texture(u_depth, st); depth.r *= 100; depth.a = 0; - vec4 v4l2 = texture(u_v4l2cam, st); + // vec4 v4l2 = texture(u_v4l2cam, st); + vec4 v4l2 = texture(u_v4l2cam, (st + vec2(300, 0)) / 3.5 + vec2(-10, 86)); 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); } else { vec4 pointCloudColor = texture(u_ofcam, st); diff --git a/zoneb/src/ofApp.cpp b/zoneb/src/ofApp.cpp index f2d1d4d..76c84cc 100644 --- a/zoneb/src/ofApp.cpp +++ b/zoneb/src/ofApp.cpp @@ -368,7 +368,9 @@ void ofApp::drawMain() { ofDisableDepthTest(); auto tex = kinectDevice.getDepthTex(); + auto ctex = kinectDevice.getColorTex(); boundShader.setUniformTexture("u_depth", tex); + boundShader.setUniformTexture("u_color", ctex); boundShader.setUniformTexture("u_ofcam", fbos.at("ofcam")); boundShader.setUniformTexture("u_energy", fbos.at("energy")); boundShader.setUniformTexture("u_v4l2cam", v4l2Buffer.at(v4l2BufferCount));