initial commit

This commit is contained in:
saarsena@gmail.com 2026-04-22 10:19:57 -04:00
commit c2bb3893a9
1038 changed files with 75846 additions and 0 deletions

35
shaders/brick.gdshader Normal file
View file

@ -0,0 +1,35 @@
shader_type spatial;
vec4 brickTile(vec2 _st, float _zoom, float _time){
_st *= _zoom;
float time = _time * 50.0;
if (fract( _st.y * 0.5) > 0.5){
_st.x += fract(time);
} else {
_st.x -= fract(time);
return vec4(fract(_st), floor(_st));
}
}
float box(vec2 _st, vec2 _size){
_size = vec2(0.5) - _size * 0.5;
vec2 uv = smoothstep(_size, _size + vec2(1e-4), _st);
uv *= smoothstep(_size, _size + vec2(1e-4), vec2(1.0) - _st);
return uv.x * uv.y;
}
float hash(vec2 p){
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
}
void fragment() {
vec4 tile = brickTile(UV, 10.0, TIME);
vec2 st = tile.xy;
vec2 id = tile.zw;
vec3 brickColor = vec3(0.1, 0.1, 0.3);
float mask = box(st, vec2(0.2));
ALBEDO = brickColor * mask;
}

View file

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

View file

@ -0,0 +1,33 @@
shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_burley, specular_schlick_ggx;
uniform vec4 albedo : source_color = vec4(1.0);
uniform sampler2D texture_albedo : source_color, filter_nearest_mipmap, repeat_enable;
uniform vec3 glow_color : source_color = vec3(0.2, 0.5, 1.0);
uniform float glow_strength : hint_range(0.0, 20.0) = 4.0;
uniform float pulse_speed : hint_range(0.0, 10.0) = 1.5;
uniform float pulse_amount : hint_range(0.0, 1.0) = 0.25;
uniform float roughness : hint_range(0.0, 1.0) = 1.0;
uniform float metallic : hint_range(0.0, 1.0) = 0.0;
uniform float specular : hint_range(0.0, 1.0) = 0.5;
uniform vec3 uv1_scale = vec3(1.0);
uniform vec3 uv1_offset = vec3(0.0);
void vertex() {
UV = UV * uv1_scale.xy + uv1_offset.xy;
}
void fragment() {
vec4 albedo_tex = texture(texture_albedo, UV);
ALBEDO = albedo.rgb * albedo_tex.rgb;
METALLIC = metallic;
ROUGHNESS = roughness;
SPECULAR = specular;
float pulse = 1.0 - pulse_amount + pulse_amount * sin(TIME * pulse_speed);
EMISSION = ALBEDO * glow_color * glow_strength * pulse;
}

View file

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

19
shaders/door.gdshader Normal file
View file

@ -0,0 +1,19 @@
shader_type spatial;
uniform sampler2D door_texture : source_color, filter_nearest, repeat_enable;
uniform vec3 uv_scale = vec3(3.0, 2.0, 3.0);
varying float is_back_face;
void vertex() {
// NORMAL is in model space here. The -Z face has NORMAL.z == -1.
is_back_face = step(NORMAL.z, -0.5);
}
void fragment() {
vec2 uv = UV * uv_scale.xy;
if (is_back_face > 0.5) {
uv.x = -uv.x;
}
ALBEDO = texture(door_texture, uv).rgb;
}

View file

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

16
shaders/lava.gdshader Normal file
View file

@ -0,0 +1,16 @@
shader_type spatial;
uniform base_texture =
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
// Called for every pixel the material is visible on.
}
//void light() {
// // Called for every pixel for every light affecting the material.
// // Uncomment to replace the default light processing function with this one.
//}

View file

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

32
shaders/torch.gdshader Normal file
View file

@ -0,0 +1,32 @@
shader_type spatial;
render_mode blend_mix, cull_back;
uniform sampler2D albedo_tex : source_color, filter_nearest;
uniform float emission_strength : hint_range(0.0, 20.0) = 6.0;
uniform float flicker_speed : hint_range(0.0, 10.0) = 3.0;
uniform float flicker_amount : hint_range(0.0, 1.0) = 0.4;
// Hue thresholds for detecting "flame" pixels
uniform float flame_min_r : hint_range(0.0, 1.0) = 0.6;
uniform float flame_max_g : hint_range(0.0, 1.0) = 0.6;
uniform float flame_max_b : hint_range(0.0, 1.0) = 0.3;
void fragment() {
vec4 tex = texture(albedo_tex, UV);
ALBEDO = tex.rgb;
ALPHA = tex.a;
ALPHA_SCISSOR_THRESHOLD = 0.01;
// Detect orange-ish flame pixels: high red, medium green, low blue
bool is_flame = tex.r > flame_min_r && tex.g < flame_max_g && tex.b < flame_max_b && tex.a > 0.5;
if (is_flame) {
// Animated flicker using layered sine waves
float t = TIME * flicker_speed;
float flicker = sin(t) * 0.5 + sin(t * 2.3 + 1.7) * 0.3 + sin(t * 5.1 + 3.2) * 0.2;
float intensity = emission_strength * (1.0 + flicker * flicker_amount);
// Warm up the emission color slightly
vec3 flame_color = tex.rgb * vec3(1.2, 0.9, 0.5);
EMISSION = flame_color * intensity;
}
}

View file

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

View file

@ -0,0 +1,90 @@
shader_type spatial;
render_mode unshaded, blend_mix, depth_draw_opaque, cull_back;
/* Wizardry + Tron aesthetic: neon brick wall effect. */
uniform float uv_scale : hint_range(0.01, 5.0) = 0.25;
uniform float trace_speed : hint_range(0.1, 8.0) = 2.5;
uniform float trace_brightness : hint_range(0.0, 4.0) = 1.2;
uniform float trace_length : hint_range(0.1, 10.0) = 2.5;
uniform float trace_density : hint_range(0.0, 1.0) = 0.55;
uniform vec3 trace_color : source_color = vec3(1.0, 0.55, 0.1);
uniform vec3 trace_head_color : source_color = vec3(1.0, 0.95, 0.7);
// Pseudo-random hash for randomizing traces per mortar segment
float hash(vec2 p) {
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
}
void fragment() {
// Scale UVs so bricks tile across the quad
vec2 uv = UV * uv_scale;
// Block grid for visual consistency
vec2 block_size = vec2(0.4, 0.55);
float mortar = 0.005;
float row = floor(uv.y / block_size.y);
float offset = mod(row, 2.0) * 0.5 * block_size.x;
float bx = fract((uv.x + offset) / block_size.x);
float by = fract(uv.y / block_size.y);
// Distance to nearest mortar/edge line
float dx = min(bx, 1.0 - bx);
float dy = min(by, 1.0 - by);
float d_mortar = min(dx, dy);
// --- Tron light-cycle tracers flowing continuously along mortar lines ---
// Masks: which mortar line we're currently on (horizontal vs vertical)
float h_mask = step(dy, dx) * (1.0 - smoothstep(0.0, mortar * 2.0, dy));
float v_mask = step(dx, dy) * (1.0 - smoothstep(0.0, mortar * 2.0, dx));
float col = floor((uv.x + offset) / block_size.x);
float period = trace_length * 3.0; // spacing between pulse heads along a line
// Horizontal mortar: one pulse per row, traveling along x (direction randomized)
float h_seed = hash(vec2(row, 17.3));
float h_dir = (h_seed < 0.5) ? -1.0 : 1.0;
float h_spd = trace_speed * (0.6 + h_seed * 0.8);
float h_head = uv.x * h_dir - TIME * h_spd + h_seed * 50.0;
float h_back = mod(h_head, period); // 0 at head, grows backward
float h_tail = max(0.0, 1.0 - h_back / trace_length);
h_tail *= h_tail; // quadratic falloff
float h_tip = exp(-24.0 * h_back * h_back / (trace_length * trace_length));
float h_gate = smoothstep(1.0 - trace_density, 1.0 - trace_density + 0.05,
hash(vec2(row, 3.1)));
// Vertical mortar: one pulse per column, traveling along y
float v_seed = hash(vec2(col, 91.7));
float v_dir = (v_seed < 0.5) ? -1.0 : 1.0;
float v_spd = trace_speed * (0.6 + v_seed * 0.8);
float v_head = uv.y * v_dir - TIME * v_spd + v_seed * 50.0;
float v_back = mod(v_head, period);
float v_tail = max(0.0, 1.0 - v_back / trace_length);
v_tail *= v_tail;
float v_tip = exp(-24.0 * v_back * v_back / (trace_length * trace_length));
float v_gate = smoothstep(1.0 - trace_density, 1.0 - trace_density + 0.05,
hash(vec2(col, 57.8)));
float trace_body = (h_tail * h_gate * h_mask) + (v_tail * v_gate * v_mask);
float trace_head = (h_tip * h_gate * h_mask) + (v_tip * v_gate * v_mask);
trace_body = clamp(trace_body, 0.0, 1.0);
trace_head = clamp(trace_head, 0.0, 1.0);
// Neon edge: bright core line + soft glow falloff
float core = 1.0 - smoothstep(0.0, mortar, d_mortar);
float glow = 1.0 - smoothstep(0.0, mortar * 5.0, d_mortar);
// Tron colors: bright white-cyan core, blue glow halo
vec3 core_color = vec3(0.9, 0.95, 1.0);
vec3 glow_color = vec3(0.7, 0.2, 0.9);
vec3 final_color = core * core_color + glow * glow_color * 0.9;
ALPHA = 0.9 + 0.6 * core;
// Trails add a warm body glow; heads pop with a bright hot tip
final_color += trace_body * trace_color * trace_brightness;
final_color += trace_head * trace_head_color * trace_brightness * 1.8;
ALBEDO = final_color;
}

View file

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

View file

@ -0,0 +1,153 @@
shader_type spatial;
// Base texture
uniform sampler2D base_texture : source_color, filter_nearest, repeat_enable;
// === WEATHERING CONTROLS ===
// Gradient (rising damp)
uniform float gradient_strength : hint_range(0.0, 1.0) = 0.6;
uniform float gradient_exponent : hint_range(1.0, 5.0) = 3.0;
uniform float gradient_noise_warp : hint_range(0.0, 1.0) = 0.4;
// Hue shifting
uniform float shadow_cool_shift : hint_range(0.0, 0.15) = 0.06;
uniform float highlight_warm_shift : hint_range(0.0, 0.15) = 0.04;
// Surface grime (noise overlay)
uniform float grime_strength : hint_range(0.0, 1.0) = 0.3;
uniform float grime_scale : hint_range(0.5, 10.0) = 3.0;
// Noise scale for large weathering patterns
uniform float weather_scale : hint_range(0.1, 5.0) = 1.2;
// Stain blotches
uniform float stain_strength : hint_range(0.0, 1.0) = 0.35;
uniform float stain_scale : hint_range(0.5, 5.0) = 2.0;
// World-space vertical mapping (replaces UV.y which tiles in Quake-style UVs)
uniform float wall_bottom : hint_range(-10.0, 50.0) = 2.5;
uniform float wall_height : hint_range(0.1, 50.0) = 3.0;
// Overall intensity multiplier
uniform float weathering_intensity : hint_range(0.0, 2.0) = 1.0;
// ============================================================
// Noise functions (no external texture needed)
// ============================================================
vec2 hash22(vec2 p) {
p = vec2(dot(p, vec2(127.1, 311.7)),
dot(p, vec2(269.5, 183.3)));
return -1.0 + 2.0 * fract(sin(p) * 43758.5453123);
}
float noise(vec2 p) {
vec2 i = floor(p);
vec2 f = fract(p);
vec2 u = f * f * (3.0 - 2.0 * f);
return mix(mix(dot(hash22(i + vec2(0.0, 0.0)), f - vec2(0.0, 0.0)),
dot(hash22(i + vec2(1.0, 0.0)), f - vec2(1.0, 0.0)), u.x),
mix(dot(hash22(i + vec2(0.0, 1.0)), f - vec2(0.0, 1.0)),
dot(hash22(i + vec2(1.0, 1.0)), f - vec2(1.0, 1.0)), u.x), u.y);
}
float fbm(vec2 p, int octaves) {
float value = 0.0;
float amplitude = 0.5;
float frequency = 1.0;
for (int i = 0; i < octaves; i++) {
value += amplitude * noise(p * frequency);
frequency *= 2.0;
amplitude *= 0.5;
}
return value;
}
// ============================================================
// RGB <-> HSV conversion
// ============================================================
vec3 rgb2hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
// ============================================================
// Main fragment
// ============================================================
void fragment() {
// Sample base texture
vec4 tex = texture(base_texture, UV);
vec3 color = tex.rgb;
// World position for noise - makes each wall unique
vec3 world_pos = (INV_VIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
vec2 wp = world_pos.xz;
// World-space vertical gradient (0 = top, 1 = bottom)
float v_pos = 1.0 - clamp((world_pos.y - wall_bottom) / wall_height, 0.0, 1.0);
// ---- COARSE WEATHERING NOISE ----
float weather_noise = fbm(wp * weather_scale, 3) * 0.5 + 0.5;
// ---- FINE SURFACE GRIME ----
float grime_noise = fbm(wp * grime_scale + vec2(50.0, 50.0), 3);
// ---- STAIN BLOTCHES ----
float stain_noise = fbm(wp * stain_scale + vec2(100.0, 200.0), 4);
stain_noise = smoothstep(0.15, 0.45, stain_noise);
// Convert to HSV
vec3 hsv = rgb2hsv(color);
// ---- GRADIENT: RISING DAMP ----
float gradient = pow(v_pos, gradient_exponent);
float warped_gradient = gradient * mix(1.0, weather_noise * 1.6, gradient_noise_warp);
warped_gradient = clamp(warped_gradient, 0.0, 1.0);
float grad_effect = warped_gradient * gradient_strength * weathering_intensity;
hsv.z -= grad_effect * 0.35;
hsv.x += grad_effect * shadow_cool_shift;
hsv.y += grad_effect * 0.12;
// ---- HUE SHIFTING ----
float luminance = hsv.z;
float cool_warm = (luminance - 0.5) * 2.0;
hsv.x += mix(shadow_cool_shift, -highlight_warm_shift, cool_warm * 0.5 + 0.5)
* weathering_intensity;
// ---- SURFACE GRIME ----
float grime_effect = grime_noise * grime_strength * weathering_intensity * 0.08;
hsv.z -= grime_effect;
hsv.y += abs(grime_effect) * 0.5;
// ---- STAIN BLOTCHES ----
float stain_effect = stain_noise * stain_strength * weathering_intensity;
hsv.z -= stain_effect * 0.1;
hsv.x += stain_effect * 0.02;
// Clamp HSV
hsv.x = fract(hsv.x);
hsv.y = clamp(hsv.y, 0.0, 1.0);
hsv.z = clamp(hsv.z, 0.0, 1.0);
// Back to RGB
color = hsv2rgb(hsv);
ALBEDO = color;
}

View file

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