I am trying to blur the part of video(Ex:Test.mp4) using QML ShaderEffect. I am getting the errors QOpenGLShader::compile(Fragment): WARNING: 1:2:GLSL version 1.20



  • fragmentShader: "
    uniform float dividerValue = 0.7;
    uniform float blurSize = 15;

    uniform sampler2D source;
    uniform lowp float qt_Opacity;
    varying vec2 qt_TexCoord0;

    void main()
    {
    vec2 uv = qt_TexCoord0.xy;
    vec4 c = vec4(0.0);
    if (uv.x < dividerValue) {
    c += texture2D(source, uv - vec2(0.0, 4.0blurSize)) * 0.05;
    c += texture2D(source, uv - vec2(0.0, 3.0
    blurSize)) * 0.09;
    c += texture2D(source, uv - vec2(0.0, 2.0blurSize)) * 0.12;
    c += texture2D(source, uv - vec2(0.0, 1.0
    blurSize)) * 0.15;
    c += texture2D(source, uv) * 0.18;
    c += texture2D(source, uv + vec2(0.0, 1.0blurSize)) * 0.15;
    c += texture2D(source, uv + vec2(0.0, 2.0
    blurSize)) * 0.12;
    c += texture2D(source, uv + vec2(0.0, 3.0blurSize)) * 0.09;
    c += texture2D(source, uv + vec2(0.0, 4.0
    blurSize)) * 0.05;

    } else {
        c = texture2D(source, qt_TexCoord0);
    
    }
    // First pass we don't apply opacity
    gl_FragColor = c;
    

    }

    "
    }


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.