Blindness hotfix (content side) (#23465)
* fixes major blindness issues like blindness not scaling with render res * HEY. get outta there
This commit is contained in:
@@ -85,7 +85,6 @@ namespace Content.Client.Eye.Blinding
|
|||||||
_circleMaskShader?.SetParameter("Zoom", content.Zoom.X);
|
_circleMaskShader?.SetParameter("Zoom", content.Zoom.X);
|
||||||
}
|
}
|
||||||
|
|
||||||
_circleMaskShader?.SetParameter("SCREEN_TEXTURE", ScreenTexture);
|
|
||||||
_greyscaleShader?.SetParameter("SCREEN_TEXTURE", ScreenTexture);
|
_greyscaleShader?.SetParameter("SCREEN_TEXTURE", ScreenTexture);
|
||||||
|
|
||||||
var worldHandle = args.WorldHandle;
|
var worldHandle = args.WorldHandle;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
path: "/Textures/Shaders/circle_mask.swsl"
|
path: "/Textures/Shaders/circle_mask.swsl"
|
||||||
params:
|
params:
|
||||||
CircleRadius: 15.0
|
CircleRadius: 15.0
|
||||||
CircleMinDist: 0.25
|
CircleMinDist: 0.0
|
||||||
CirclePow: 0.5
|
CirclePow: 0.5
|
||||||
CircleMax: 4.0
|
CircleMax: 4.0
|
||||||
CircleMult: 0.5
|
CircleMult: 0.5
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ uniform highp float Zoom;
|
|||||||
|
|
||||||
// Base distortion
|
// Base distortion
|
||||||
uniform highp float DistortionScalar; // Scales the total distortion applied to the final image.
|
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 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 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
|
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 distortionZoom = pow(Zoom, DistortionZoomPow);
|
||||||
|
|
||||||
highp float centergradient = zCircleGradient(aspect * 0.5, FRAGCOORD.xy, DistortionGradientMax, DistortionCenterRadius / distortionZoom, DistortionCenterMinDist / distortionZoom, DistortionCenterPow);
|
highp float centergradient = zCircleGradient(aspect, 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 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);
|
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));
|
COLOR = zTextureSpec(SCREEN_TEXTURE, Pos + (offset * DistortionScalar));
|
||||||
|
|
||||||
highp float cloudyZoom = pow(Zoom, CloudinessZoomPow);
|
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 = mix(COLOR.rgb, vec3(zGrayscale(COLOR.rgb)), min(cloudygradient * CloudinessGrayscaleMult, CloudinessGrayscaleMax));
|
||||||
COLOR.rgb = pow(COLOR.rgb, vec3((cloudygradient * CloudinessScalar + 1.0)));
|
COLOR.rgb = pow(COLOR.rgb, vec3((cloudygradient * CloudinessScalar + 1.0)));
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
uniform sampler2D SCREEN_TEXTURE;
|
|
||||||
uniform highp float Zoom;
|
uniform highp float Zoom;
|
||||||
|
|
||||||
uniform highp float CircleRadius; //= 15.0; // radius of the circular gradient
|
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 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 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.
|
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 vec2 aspect = vec2(1.0/SCREEN_PIXEL_SIZE.x, 1.0/SCREEN_PIXEL_SIZE.y);
|
||||||
highp float actualZoom = Zoom;
|
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));
|
COLOR = mix(vec4(0.0), vec4(vec3(0.0), 1.0), clamp(circle, 0.0, 1.0));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user