]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix: deglitchify drowsiness effect on macOS (#37817)
authorPerry Fraser <perryprog@users.noreply.github.com>
Tue, 17 Jun 2025 21:05:12 +0000 (17:05 -0400)
committerGitHub <noreply@github.com>
Tue, 17 Jun 2025 21:05:12 +0000 (23:05 +0200)
Resources/Textures/Shaders/radial_blur.swsl

index f3224ce06c9edffa54fc95a976a493a5e58e38b6..55a89c31b4205c29726a84b8bcc0f7c0ef0c46c6 100644 (file)
@@ -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);
 }