From 9a605c864278b988f1dd5aa8016930199a339cd6 Mon Sep 17 00:00:00 2001 From: Perry Fraser Date: Tue, 17 Jun 2025 17:05:12 -0400 Subject: [PATCH] fix: deglitchify drowsiness effect on macOS (#37817) --- Resources/Textures/Shaders/radial_blur.swsl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Resources/Textures/Shaders/radial_blur.swsl b/Resources/Textures/Shaders/radial_blur.swsl index f3224ce06c..55a89c31b4 100644 --- a/Resources/Textures/Shaders/radial_blur.swsl +++ b/Resources/Textures/Shaders/radial_blur.swsl @@ -4,11 +4,13 @@ const highp int SampleCount = 10; // a higher number makes the shader look bette // a simple radial blur void fragment() { - highp vec2 uv = FRAGCOORD.xy * SCREEN_PIXEL_SIZE.xy; - highp vec2 direction = vec2(0.5, 0.5) - uv; + highp vec3 col = texture(SCREEN_TEXTURE, UV).xyz; + highp vec4 color = zTexture(UV); + highp vec2 direction = vec2(0.5, 0.5) - UV; for (int i=1; i <= SampleCount; i++) { - COLOR += zTextureSpec(SCREEN_TEXTURE, uv + float(i) * Strength / float(SampleCount) * direction); + col += zTextureSpec(SCREEN_TEXTURE, UV + float(i) * Strength / float(SampleCount) * direction).xyz; } - COLOR = COLOR / float(SampleCount); + col = col / float(SampleCount); + COLOR = vec4(vec3(col), color.a); } -- 2.51.2