Hello.
I was noticing blurriness when using sharp-bilinear simple in my 720p setup with 240p content. Indeed it seems that the prescale calculated by the shader (which I always understood should be 3x integer in this case) is incorrect. I tried to see what happens when changing floor
to ceil
in line 60 of interpolation/shaders/sharp-bilinear-simple.glsl
precalc_scale = max(floor(outsize.xy / InputSize.xy), vec2(1.0, 1.0));
This gives the proper prescale. Additionally, it provides nice sharp scaling for double-res 480p content (e.g. PCSX-Rearmed enhanced resolution mode) scaled 1.5x to 720p. I really like the result but I am not sure this would be a proper “fix”.
My question is, does the shader need fixing, is it a quirk in my hardware, or is the current behavior what is expected? I originally encountered this behavior on my Raspberry Pi3 (glsl) which I attributed to GPU rounding errors, but now I also notice it in testing on my PC with the slang shader (same effect) in a 1280x720 window.
This is a very fast and useful shader and I think it would be nice to have it fixed, if it needs fixing.
Here are some examples I took for 240p and 480p with nearest, sharp-bilinear-simple (floor) and sharp-bilinear-simple (ceil).
240p-3x-nearest (562 colors)
240p-3x-floor (10439 colors)
240p-3x-ceil (562 colors)
480p-1.5x-nearest (719 colors)
480p-1.5x-floor (54168 colors)
480p-1.5x-ceil (11539 colors)