We only considered residual in the positive direction, i.e. we would set
dithering to zero if the color is (whole number + 0.0001). But we should
also set dithering to zero if color is (whole number - 0.0001).
Fixes#1064
The rounded corner calculation only took the actual texture dimensions
into account, effectively turning all pixels outside completely
transparent. Furthermore, `texelFetch()` in the default window shader
does not work with any `GL_TEXTURE_WRAP_x` parameter.
As a result, a to-be-tiled root pixmap wasn't properly tiled and only
visible in the original top-left corner.
- Changed the default window shader to use `textureSize()` to scale the
texture coordinates into the proper range for use with `texture2D()`.
- Added a new uniform to the default post-processing shader containing
the effective texture size for rounded corners calculation instead of
relying on `textureSize()`.
If a pixel is perfectly representable as an 8-bit number, don't add
dither. Reduce artifacts where dither is unnecessary.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Add bayer ordered dithering when presenting to screen. Reduce banding
when using a strong blur. Also use 16-bit intermediary textures to
preserve precision in the rendering pipeline.
Related: #602
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>