- // We also choose to dither alpha, just in case.
- // Maybe it should in theory have a separate dither,
- // but I doubt it matters much.
- vec4 result = INPUT(tc) + texture2D(PREFIX(dither_tex), tc * PREFIX(tc_scale)).xxxx;
+ vec4 result = INPUT(tc);
+
+ // Don't dither alpha; the case of alpha=255 (1.0) is very important to us,
+ // and if there's any inaccuracy earlier in the chain so that it becomes e.g.
+ // 254.8, it's better to just get it rounded off than to dither and have it
+ // possibly get down to 254. This is not the case for the color components.
+ result.rgb += tex2D(PREFIX(dither_tex), tc * PREFIX(tc_scale)).xxx;