]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Blindness hotfix (content side) (#23465)
authordeathride58 <deathride58@users.noreply.github.com>
Thu, 4 Jan 2024 00:17:06 +0000 (19:17 -0500)
committerGitHub <noreply@github.com>
Thu, 4 Jan 2024 00:17:06 +0000 (11:17 +1100)
* fixes major blindness issues like blindness not scaling with render res

* HEY. get outta there

Content.Client/Eye/Blinding/BlindOverlay.cs
Resources/Prototypes/Shaders/shaders.yml
Resources/Textures/Shaders/cataracts.swsl
Resources/Textures/Shaders/circle_mask.swsl

index 0e380a515fd3cdb4516b2fb67be689fe4c65da8f..1949b170ab890bd4f294878a22aced6cfdb6c60a 100644 (file)
@@ -85,7 +85,6 @@ namespace Content.Client.Eye.Blinding
                 _circleMaskShader?.SetParameter("Zoom", content.Zoom.X);
             }
 
-            _circleMaskShader?.SetParameter("SCREEN_TEXTURE", ScreenTexture);
             _greyscaleShader?.SetParameter("SCREEN_TEXTURE", ScreenTexture);
 
             var worldHandle = args.WorldHandle;
index 560f6b576d1cff990ecf9d129787b5b822ae303e..e286dcb7a4197c18e78044f4c55db0718c85fa70 100644 (file)
@@ -4,7 +4,7 @@
   path: "/Textures/Shaders/circle_mask.swsl"
   params:
     CircleRadius: 15.0
-    CircleMinDist: 0.25
+    CircleMinDist: 0.0
     CirclePow: 0.5
     CircleMax: 4.0
     CircleMult: 0.5
index 5ba33db9e5b94507e43d3b780bf48840a01f2bab..86188fdce234e8a7fa0dddcc4857b8081a0680f4 100644 (file)
@@ -24,6 +24,7 @@ uniform highp float Zoom;
 
 // Base distortion
 uniform highp float DistortionScalar; // Scales the total distortion applied to the final image.
+const highp float DistortionCoordScalar = 0.1125; //Scales the coordinates for the distortion texture
 const highp float DistortionCenterRadius = 200.0; // radius of the gradient used to tone down the distortion effect
 const highp float DistortionCenterMinDist = 0.25; // minimum distance from the center of the screen for the distortion to appear at all
 const highp float DistortionCenterPow = 1.1; // the exponent used for the distortion center
@@ -58,14 +59,14 @@ void fragment() {
 
     highp float distortionZoom = pow(Zoom, DistortionZoomPow);
 
-    highp float centergradient = zCircleGradient(aspect * 0.5, FRAGCOORD.xy, DistortionGradientMax, DistortionCenterRadius / distortionZoom, DistortionCenterMinDist / distortionZoom, DistortionCenterPow);
-    highp vec2 coord = (FRAGCOORD.xy * SCREEN_PIXEL_SIZE.xy) * aspect * centergradient * 0.0001; // That magic number on the end there is due to how tiny the FBM noise is. It's incredibly noisy.
+    highp float centergradient = zCircleGradient(aspect, FRAGCOORD.xy, DistortionGradientMax, DistortionCenterRadius / distortionZoom, DistortionCenterMinDist / distortionZoom, DistortionCenterPow);
+    highp vec2 coord = (FRAGCOORD.xy * SCREEN_PIXEL_SIZE.xy) * centergradient * DistortionCoordScalar;
     highp vec2 offset = vec2((zFBM(coord * NoiseScalar + timesin) - 0.5) * centergradient, (zFBM(coord * NoiseScalar + timecos) - 0.5) * centergradient);
     COLOR = zTextureSpec(SCREEN_TEXTURE, Pos + (offset * DistortionScalar));
 
     highp float cloudyZoom = pow(Zoom, CloudinessZoomPow);
 
-    highp float cloudygradient = zCircleGradient(aspect * 0.5, FRAGCOORD.xy, CloudinessGradientMax, CloudinessCenterRadius / cloudyZoom, CloudinessCenterMinDist / cloudyZoom, CloudinessCenterPow) * CloudinessScalar;
+    highp float cloudygradient = zCircleGradient(aspect, FRAGCOORD.xy, CloudinessGradientMax, CloudinessCenterRadius / cloudyZoom, CloudinessCenterMinDist / cloudyZoom, CloudinessCenterPow) * CloudinessScalar;
     COLOR.rgb = mix(COLOR.rgb, vec3(zGrayscale(COLOR.rgb)), min(cloudygradient * CloudinessGrayscaleMult, CloudinessGrayscaleMax));
     COLOR.rgb = pow(COLOR.rgb, vec3((cloudygradient * CloudinessScalar + 1.0)));
 
index 872e48989b30abe1931e0f63caea5a80482474c5..5b2773e9babf62ae583560b87812302e585119ad 100644 (file)
@@ -1,8 +1,7 @@
-uniform sampler2D SCREEN_TEXTURE;
 uniform highp float Zoom;
 
 uniform highp float CircleRadius; //= 15.0; // radius of the circular gradient
-uniform highp float CircleMinDist; //= 0.25; // minimum distance from the center of the screen for the gradient
+uniform highp float CircleMinDist; //= 0.0; // minimum distance from the center of the screen for the gradient
 uniform highp float CirclePow; //= 0.5; // the exponent used for the gradient
 uniform highp float CircleMax; //= 4.0; // Maximum value for the gradient used for the gradient. Don't worry, the end result gets clamped.
 uniform highp float CircleMult; //= 0.5; // Multiplier for the total value of the circle gradient.
@@ -12,6 +11,6 @@ void fragment(){
     highp vec2 aspect = vec2(1.0/SCREEN_PIXEL_SIZE.x, 1.0/SCREEN_PIXEL_SIZE.y);
     highp float actualZoom = Zoom;
 
-    highp float circle = zCircleGradient(aspect * 0.5, FRAGCOORD.xy, CircleMax, CircleRadius / actualZoom, /*CircleMinDist / actualZoom*/ 0.0, CirclePow) * CircleMult;
+    highp float circle = zCircleGradient(aspect, FRAGCOORD.xy, CircleMax, CircleRadius / actualZoom, CircleMinDist / actualZoom, CirclePow) * CircleMult;
     COLOR = mix(vec4(0.0), vec4(vec3(0.0), 1.0), clamp(circle, 0.0, 1.0));
 }