Make sanity more intense
This commit is contained in:
@@ -5,6 +5,9 @@ uniform float Desat;
|
||||
uniform float BlurAmount;
|
||||
uniform float Vignette;
|
||||
uniform float FogStrength;
|
||||
uniform float PulseStrength;
|
||||
uniform float Time;
|
||||
uniform float FlashStrength;
|
||||
|
||||
in vec2 texCoord;
|
||||
in vec2 oneTexel;
|
||||
@@ -17,29 +20,53 @@ vec4 sampleBlur() {
|
||||
float w = BlurAmount * 0.5;
|
||||
|
||||
vec4 sum = vec4(0.0);
|
||||
sum += texture(DiffuseSampler, texCoord + oneTexel * vec2(-1, 0)) * w;
|
||||
sum += texture(DiffuseSampler, texCoord + oneTexel * vec2( 1, 0)) * w;
|
||||
sum += texture(DiffuseSampler, texCoord + oneTexel * vec2( 0, -1)) * w;
|
||||
sum += texture(DiffuseSampler, texCoord + oneTexel * vec2( 0, 1)) * w;
|
||||
sum += texture(DiffuseSampler, texCoord + oneTexel * vec2(-1, 0)) * w;
|
||||
sum += texture(DiffuseSampler, texCoord + oneTexel * vec2( 1, 0)) * w;
|
||||
sum += texture(DiffuseSampler, texCoord + oneTexel * vec2( 0,-1)) * w;
|
||||
sum += texture(DiffuseSampler, texCoord + oneTexel * vec2( 0, 1)) * w;
|
||||
|
||||
vec4 center = texture(DiffuseSampler, texCoord) * (1.0 - w * 4.0);
|
||||
|
||||
return center + sum;
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 col = texture(DiffuseSampler, texCoord);
|
||||
|
||||
// Blur
|
||||
vec4 blurred = sampleBlur();
|
||||
col = mix(col, blurred, BlurAmount);
|
||||
|
||||
// Grayscale
|
||||
float gray = dot(col.rgb, vec3(0.2126, 0.7152, 0.0722));
|
||||
col.rgb = mix(col.rgb, vec3(gray), clamp(Desat, 0.0, 1.0));
|
||||
|
||||
col.rgb = mix(col.rgb, vec3(0.75, 0.75, 0.8), FogStrength);
|
||||
// Fog
|
||||
col.rgb = mix(col.rgb, vec3(0.75), FogStrength);
|
||||
|
||||
float dist = distance(texCoord, vec2(0.5, 0.5));
|
||||
float vign = smoothstep(0.3, 0.7, dist);
|
||||
col.rgb = mix(col.rgb, col.rgb * 0.4, vign * Vignette);
|
||||
// Stronger base vignette
|
||||
float dist = distance(texCoord, vec2(0.5));
|
||||
float vign = smoothstep(0.15, 0.6, dist);
|
||||
col.rgb = mix(col.rgb, vec3(0.0), vign * Vignette);
|
||||
|
||||
// Pulsating vignette toward black
|
||||
if (PulseStrength > 0.001) {
|
||||
float pulse = (sin(Time * 4.0) * 0.5 + 0.5);
|
||||
pulse *= PulseStrength;
|
||||
|
||||
float pVig = smoothstep(0.2, 0.8, dist);
|
||||
col.rgb = mix(col.rgb, vec3(0.0), pVig * pulse);
|
||||
}
|
||||
if (FlashStrength > 0.001) {
|
||||
float wave = sin(Time * 12.0); // slower: 12 instead of 40
|
||||
float intensity = (abs(wave) * 0.65) * FlashStrength;
|
||||
// max 25% brightness shift even at 100% insanity
|
||||
|
||||
// shift colors subtly instead of full white/black
|
||||
vec3 flashColor = wave > 0.0
|
||||
? vec3(0.9, 0.9, 1.0) // pale bluish-white
|
||||
: vec3(0.05, 0.05, 0.07); // deep blue-black
|
||||
|
||||
col.rgb = mix(col.rgb, flashColor, intensity);
|
||||
}
|
||||
fragColor = vec4(col.rgb, 1.0);
|
||||
}
|
||||
@@ -72,6 +72,30 @@
|
||||
"type": "float",
|
||||
"count": 1,
|
||||
"values": [ 0.0 ]
|
||||
},
|
||||
{
|
||||
"name": "ShakeStrength",
|
||||
"type": "float",
|
||||
"count": 1,
|
||||
"values": [ 0.0 ]
|
||||
},
|
||||
{
|
||||
"name": "PulseStrength",
|
||||
"type": "float",
|
||||
"count": 1,
|
||||
"values": [ 0.0 ]
|
||||
},
|
||||
{
|
||||
"name": "Time",
|
||||
"type": "float",
|
||||
"count": 1,
|
||||
"values": [ 0.0 ]
|
||||
},
|
||||
{
|
||||
"name": "FlashStrength",
|
||||
"type": "float",
|
||||
"count": 1,
|
||||
"values": [ 0.0 ]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -4,11 +4,24 @@ in vec4 Position;
|
||||
|
||||
uniform mat4 ProjMat;
|
||||
uniform vec2 OutSize;
|
||||
uniform float ShakeStrength;
|
||||
uniform float Time;
|
||||
|
||||
out vec2 texCoord;
|
||||
|
||||
void main() {
|
||||
vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0);
|
||||
|
||||
// screen-shake offset in *pixels*
|
||||
float px = sin(Time * 25.0 + Position.x * 5.0) * ShakeStrength * 20.0;
|
||||
float py = cos(Time * 20.0 + Position.y * 7.0) * ShakeStrength * 20.0;
|
||||
|
||||
// convert from pixels → normalized coordinates
|
||||
vec2 offset = vec2(px / OutSize.x, py / OutSize.y);
|
||||
|
||||
vec2 shaken = Position.xy + offset;
|
||||
|
||||
texCoord = shaken / OutSize;
|
||||
|
||||
vec4 outPos = ProjMat * vec4(shaken, 0.0, 1.0);
|
||||
gl_Position = vec4(outPos.xy, 0.0, 1.0);
|
||||
texCoord = Position.xy / OutSize;
|
||||
}
|
||||
Reference in New Issue
Block a user