Game files

This commit is contained in:
June
2026-03-24 12:56:35 -07:00
parent 7258b2e118
commit 44e67067a0
6027 changed files with 76278 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
shader_type canvas_item;
/**
* In relative units now (0-1)
*/
uniform float zoom = 1.0;
/**
* Higher values = less distortion in the center
*/
uniform float sharpness = 2.0;
/**
* (1, 0) for horizontal only, (0, 1) for vertical only
*/
uniform vec2 direction = vec2(1.0, 0.0);
/**
* 0: Repeats
* 1: Clamps
* 2: Clips
*/
uniform int wrapping_mode = 0;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
void fragment() {
float fB;
float fC;
vec2 posTex;
vec4 color = vec4(0.0, 0.0, 0.0, 1.0);
vec2 uv = SCREEN_UV;
vec2 ndir = normalize(direction);
float fac1 = abs(dot(uv - 0.5, normalize(ndir.yx))) * 2.0;
float fac2 = -dot(uv - 0.5, normalize(ndir)) * 2.0;
vec2 new_uv = uv + pow(fac1, sharpness) * fac2 * zoom * ndir;
switch (wrapping_mode)
{
case 2:
if (0.0 > new_uv.x || new_uv.x > 1.0 || 0.0 > new_uv.y || new_uv.y > 1.0)
{
COLOR = vec4(0);
break;
}
case 0:
new_uv = fract(new_uv);
// fall-through
case 1:
new_uv = clamp(new_uv, vec2(0), vec2(1));
COLOR = textureLod(SCREEN_TEXTURE, new_uv, 0.0);
break;
}
}

View File

@@ -0,0 +1 @@
uid://sxb00aj6wt0h

View File

@@ -0,0 +1,21 @@
shader_type canvas_item;
// Parameters
uniform float alpha_threshold : hint_range(0.0, 1.0) = 0.1; // below this = fully transparent
uniform float alpha_modifier : hint_range(0.0, 1.0) = 1.0; // global alpha multiplier
void fragment() {
// Sample the current frame automatically
vec4 tex_color = texture(TEXTURE, UV);
// Convert color to luminance (grayscale)
float lum = dot(tex_color.rgb, vec3(0.299, 0.587, 0.114));
// Apply threshold: if below threshold, alpha = 0
float alpha = lum < alpha_threshold ? 0.0 : lum;
// Apply global modifier
alpha *= alpha_modifier;
COLOR = vec4(tex_color.rgb, alpha);
}

View File

@@ -0,0 +1 @@
uid://cb1jf4frbw7jo