From d5b5163828a617045d22d9e7c51a0ece961d47ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Tue, 1 Oct 2024 14:33:57 +0200 Subject: [PATCH] [qt6] Remove shaders from Meshroom and move them to QtAliceVision --- .../qml/GraphEditor/AttributeItemDelegate.qml | 11 +------- meshroom/ui/qml/Viewer3D/ImageOverlay.qml | 26 +------------------ 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index e18e3ced..a6d212b5 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -752,16 +752,7 @@ RowLayout { width: control.availableWidth height: control.availableHeight blending: false - fragmentShader: " - varying mediump vec2 qt_TexCoord0; - vec3 hsv2rgb(vec3 c) { - vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); - vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); - return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); - } - void main() { - gl_FragColor = vec4(hsv2rgb(vec3(qt_TexCoord0.x, 1.0, 1.0)), 1.0); - }" + fragmentShader: "qrc:/shaders/AttributeItemDelegate.frag.qsb" } } } diff --git a/meshroom/ui/qml/Viewer3D/ImageOverlay.qml b/meshroom/ui/qml/Viewer3D/ImageOverlay.qml index f203a8f9..e4b2d48c 100644 --- a/meshroom/ui/qml/Viewer3D/ImageOverlay.qml +++ b/meshroom/ui/qml/Viewer3D/ImageOverlay.qml @@ -70,30 +70,6 @@ Item { property variant src: image property variant uvCenterOffset - vertexShader: " - #version 330 core - uniform highp mat4 qt_Matrix; - attribute highp vec4 qt_Vertex; - attribute highp vec2 qt_MultiTexCoord0; - out highp vec2 coord; - void main() { - coord = qt_MultiTexCoord0; - gl_Position = qt_Matrix * qt_Vertex; - }" - fragmentShader: " - #version 330 core - in highp vec2 coord; - uniform sampler2D src; - uniform lowp vec2 uvCenterOffset; - uniform lowp float qt_Opacity; - out vec4 fragColor; - void main() { - vec2 xy = coord + uvCenterOffset; - fragColor = texture2D(src, xy); - fragColor.rgb *= qt_Opacity; - fragColor.a = qt_Opacity; - // remove undistortion black pixels - fragColor.a *= step(0.001, fragColor.r + fragColor.g + fragColor.b); - }" + fragmentShader: "qrc:/shaders/ImageOverlay.frag.qsb" } }