From a80ec564c6dc6045e9face916a2db359eb762833 Mon Sep 17 00:00:00 2001 From: Andrea Maggiordomo Date: Thu, 20 May 2021 10:41:33 +0200 Subject: [PATCH] mac fix --- .../src/texture_rendering.cpp | 30 ++++++++----------- .../filter_texture_defragmentation.cpp | 2 +- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/meshlabplugins/filter_texture_defragmentation/TextureDefragmentation/src/texture_rendering.cpp b/src/meshlabplugins/filter_texture_defragmentation/TextureDefragmentation/src/texture_rendering.cpp index ffaed6b91..85a7ff36e 100644 --- a/src/meshlabplugins/filter_texture_defragmentation/TextureDefragmentation/src/texture_rendering.cpp +++ b/src/meshlabplugins/filter_texture_defragmentation/TextureDefragmentation/src/texture_rendering.cpp @@ -40,13 +40,11 @@ static const char *vs_text[] = { - "#version 410 core \n" - " \n" - "in vec2 position; \n" - "in vec2 texcoord; \n" - "in vec4 color; \n" - "out vec2 uv; \n" - "out vec4 fcolor; \n" + "attribute vec2 position; \n" + "attribute vec2 texcoord; \n" + "attribute vec4 color; \n" + "varying vec2 uv; \n" + "varying vec4 fcolor; \n" " \n" "void main(void) \n" "{ \n" @@ -59,25 +57,21 @@ static const char *vs_text[] = { }; static const char *fs_text[] = { - "#version 410 core \n" - " \n" "uniform sampler2D img0; \n" " \n" "uniform vec2 texture_size; \n" "uniform int render_mode; \n" " \n" - "in vec2 uv; \n" - "in vec4 fcolor; \n" - " \n" - "out vec4 texelColor; \n" + "varying vec2 uv; \n" + "varying vec4 fcolor; \n" " \n" "void main(void) \n" "{ \n" " if (render_mode == 0) { \n" - " if (uv.s < 0) \n" - " texelColor = vec4(0, 1, 0, 1); \n" + " if (uv.s < float(0)) \n" + " gl_FragColor = vec4(0, 1, 0, 1); \n" " else \n" - " texelColor = vec4(texture2D(img0, uv).rgb, 1); \n" + " gl_FragColor = vec4(texture2D(img0, uv).rgb, 1); \n" " } else if (render_mode == 1) { \n" " vec2 coord = uv * texture_size - vec2(0.5, 0.5); \n" " vec2 idx = floor(coord); \n" @@ -99,9 +93,9 @@ static const char *fs_text[] = { " vec4 tex11 = texture2D(img0, vec2(h1.x, h1.y) / texture_size);\n" " tex00 = mix(tex00, tex01, g1.y); \n" " tex10 = mix(tex10, tex11, g1.y); \n" - " texelColor = mix(tex00, tex10, g1.x); \n" + " gl_FragColor = mix(tex00, tex10, g1.x); \n" " } else { \n" - " texelColor = fcolor; \n" + " gl_FragColor = fcolor; \n" " } \n" "} \n" }; diff --git a/src/meshlabplugins/filter_texture_defragmentation/filter_texture_defragmentation.cpp b/src/meshlabplugins/filter_texture_defragmentation/filter_texture_defragmentation.cpp index 32184bd27..5b7f281cb 100644 --- a/src/meshlabplugins/filter_texture_defragmentation/filter_texture_defragmentation.cpp +++ b/src/meshlabplugins/filter_texture_defragmentation/filter_texture_defragmentation.cpp @@ -56,7 +56,7 @@ FilterTextureDefragPlugin::FilterTextureDefragPlugin() for(ActionIDType tt: types()) actionList.push_back(new QAction(filterName(tt), this)); - LOG_INIT(logging::Level::Warning); + LOG_INIT(logging::Level::Debug); LOG_SET_THREAD_NAME("TextureDefrag"); }