[Bug 31499] [r300g] KWin Lanczos filter problems - Black Windows using effects

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Nov 20 11:35:50 PST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=31499

--- Comment #7 from Tom Stellard <tstellar at gmail.com> 2010-11-20 11:35:49 PST ---
Actually calculating the offset values inside the shader would be even better. 
So something like this:

uniform sampler2D texUnit;
uniform vec4 kernel[25];
uniform int direction;
uniform int count;
uniform float width;

void main(void)
{
    vec4 sum = texture2D(texUnit, gl_TexCoord[0].st) * kernel[0];
    for (int i = 1; i < 25; i++) {
        vec2 offset = (direction == 0 ? vec2(i / width, 0.0) :
                                        vec2(0.0, i / width);
        offset = (i < count) ? offset : vec2(0.0, 0.0);
        sum += texture2D(texUnit, gl_TexCoord[0].st - offset) * kernel[i];
        sum += texture2D(texUnit, gl_TexCoord[0].st + offset) * kernel[i];
    }
    gl_FragColor = sum;
}

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the dri-devel mailing list