Commit Graph

8 Commits

Author SHA1 Message Date
Yuxuan Shui b368072e12
Merge pull request #1002 from tryone144/fix/use-effective-texture-size-for-corner-radius 2023-12-20 10:48:14 +00:00
Yuxuan Shui 3aed5599c3
glx: calculate residual in both directions
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
2023-05-08 15:01:50 +01:00
Bernd Busse 332501aef7
backend: gl: use effective texture size for rounded corner calculation
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()`.
2023-01-20 00:08:03 +01:00
Yuxuan Shui d704e0f80e
backend: gl: don't add dither where it's not needed
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>
2022-11-30 12:15:34 +00:00
Yuxuan Shui 0a2cd0f14e
backend: gl: add dither
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>
2022-11-30 05:08:02 +00:00
Yuxuan Shui 5d2f8d7456
backend: gl: fix visible seam in shadow at edge of windows
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-31 07:00:58 +01:00
Yuxuan Shui a29caeaf3d
ackend: gl: implement shadow_from_mask
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-31 07:00:41 +01:00
Yuxuan Shui e2d990dc3d
backend: gl: split code into multiple files
gl_common.c is getting too big.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-25 13:31:54 +01:00