From 928302f76b243e50a032f18399813fa9a27b7b8c Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 16 Mar 2015 19:49:14 +0100 Subject: spherical projection III: vignette --- client2.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client2.cpp b/client2.cpp index 0f1f1ac..5b04602 100644 --- a/client2.cpp +++ b/client2.cpp @@ -63,7 +63,7 @@ const char* drawOnCanvasFragmentSource = "const float CAM_YRES=720;\n" "const float CAM_XDEG=70/180.*3.141592654;\n" "const float CAM_FX=CAM_XRES/2.0 / tan(CAM_XDEG/2.0);\n" - //"const float CAM_FX=1;\n" + "const float margin_thickness=100;\n" "const mat3 cam_cal = transpose(mat3(CAM_FX, 0, CAM_XRES/2, 0, CAM_FX, CAM_YRES/2, 0,0,1));\n" "const mat3 math_to_opencv = transpose(mat3(0,1,0, 0,0,1, -1,0,0));\n" "in vec2 Texcoord;\n" @@ -82,7 +82,12 @@ const char* drawOnCanvasFragmentSource = " if ( point_in_cam_pic_uniform.z < 0 && \n" " (0 <= point_in_cam_pic.x && point_in_cam_pic.x < CAM_XRES) && \n" " (0 <= point_in_cam_pic.y && point_in_cam_pic.y < CAM_YRES) ) \n" + " {\n" " outColor = texture(texVideo, vec2(1.0,1.0)-point_in_cam_pic/vec2(CAM_XRES,CAM_YRES));\n" + " float xmarg = min( (min(point_in_cam_pic.x, CAM_XRES-point_in_cam_pic.x)/margin_thickness), 1.0);\n" + " float ymarg = min( (min(point_in_cam_pic.y, CAM_YRES-point_in_cam_pic.y)/margin_thickness), 1.0);\n" + " outColor.a=xmarg*ymarg;\n" + " }\n" //" outColor = vec4(point_in_cam_pic/vec2(CAM_XRES,CAM_YRES),-point_in_cam_pic_uniform.z/1000,1);\n" " else\n" " outColor = vec4(0.0,0.0,0.0,0.00);" -- cgit v1.2.3