Filter 2D Drastic fps drop in standalone player

I have a basic blur filter I made from replicating a tutorial script (and with some helpful edits from people on these forums).

I toggle it on and using the space key as seen in the video below. It runs fine in the bge, but when I switch to standalone, the fps drops considerably.

I have the .blend of it below. I’m first curious to see if this is just something that happens on my PC, or if it’s on anyone else’s PC.

If so, Is it something in the filter that’s demanding a lot of CPU/GPU?

Example_1.blend (595.0 KB)

it works fine for me. 60/60 fps when no blur / blur enabled.

also I improved your code:

uniform sampler2D bgl_RenderedTexture;

uniform int SAMPLES = 16;
uniform float BLUR = 0.002;

void main()
{
    
    vec4 color = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st);
    
    int i, j, count;
    vec4 sum = vec4(0);
    for (i = -SAMPLES; i <= SAMPLES; i++)
    {
        for (j = -SAMPLES; j <= SAMPLES; j++)
        {
            vec2 offset = vec2(i, j) * BLUR;
            sum += texture2D(bgl_RenderedTexture, gl_TexCoord[0].st + offset);
            count += 1;
        }    
    }
    
    gl_FragColor = sum / (count);
}   

Thanks for the Improved script! :smiley:

However the big fps drop in standalone still remains. I’m wondering if it’s just my computer.

try turning down the SAMPLES variable at the top of the code.

What makes this so strange is that it runs completely fine on bge, even as as high 16 samples. When I run it on the standalone, at even 3 samples, it just drops to 30 fps, and stays there until I get above 6 samples, then it starts to drop further. :confused:

It almost seems like something is manually turning down the maximum frames per second when enable the filter.

could it be a power management setting? perhaps blender is bumping up the power state, but the standalone is too light?

try having blender open when you run the standalone.

Are you using the filter on a similarly sized window in the standalone player? GLSL filters work by running the provided code on each pixel in a rendered output, so the larger your window, the harder the graphics card has to work.

If you’ve been working in Blender in a smaller 3D viewport, then moving to a maximized or fullscreen standalone player, that might account for it.

Well I found the problem, it’s my computer. This runs fine on any other computer I put it on and try, and maintains 60 fps throughout both standalone and bge. I’ve had some graphics driver issues recently, and it’s probably something related to that.

Thanks for all the feedback.