From 52c9809c659ffb095ca0e5a9c47fc30148cf9f1d Mon Sep 17 00:00:00 2001 From: Valerie Date: Mon, 8 Apr 2024 19:32:18 -0400 Subject: [PATCH] dither now respects pixel size setting --- shaders/composite.fsh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/shaders/composite.fsh b/shaders/composite.fsh index d885535..baf35be 100644 --- a/shaders/composite.fsh +++ b/shaders/composite.fsh @@ -61,12 +61,16 @@ const int indexMatrix8x8[64] = int[](0, 32, 8, 40, 2, 34, 10, 42, 63, 31, 55, 23, 61, 29, 53, 21); float indexValue() { - int x = int(mod(gl_FragCoord.x, 4)); - int y = int(mod(gl_FragCoord.y, 4)); + #if pixelSize > 1 + vec2 coord = gl_FragCoord.xy / pixelSize; + #else + vec2 coord = gl_FragCoord.xy; + #endif + int x = int(mod(coord.x, 4)); + int y = int(mod(coord.y, 4)); return indexMatrix4x4[(x + y * 4)] / 16.0; } - float hueDistance(float h1, float h2) { float diff = abs((h1 - h2)); return min(abs((1.0 - diff)), diff);