4.6, new attack, enemy spawning, shaders, bunch of stuff

This commit is contained in:
Daniel Kauss Serna 2026-02-17 01:24:05 +01:00
parent e08e3ebb13
commit 19517a3176
84 changed files with 13348 additions and 91399 deletions

View file

@ -1,13 +1,28 @@
shader_type canvas_item;
uniform sampler2D mask; // a texture
uniform float progress : hint_range(0.0, 1.0, 0.001);
uniform sampler2D noise_texture : repeat_disable, filter_nearest;
uniform float progress : hint_range(0.0, 1.0) = 0.0;
uniform float edge_softness : hint_range(0.0, 0.5) = 0.0;
void fragment() {
float mask_value = texture(mask, UV).r;
vec4 sprite_color = texture(TEXTURE, UV);
float noise_val = texture(noise_texture, UV).r;
// ensure the progress is a bit bigger than the feather
float threshold = progress * 1.001;
// Fade alpha based on mask vs. threshold with a feather
COLOR.a *= smoothstep(threshold, threshold * 0.999, mask_value);
float phase1_progress = clamp(progress * 2.0, 0.0, 1.0);
float phase2_progress = clamp((progress - 0.5) * 2.0, 0.0, 1.0);
float visibility = smoothstep(noise_val - edge_softness, noise_val + edge_softness, phase1_progress);
float color_transition = smoothstep(noise_val - edge_softness, noise_val + edge_softness, phase2_progress);
vec4 white_color = vec4(1.0, 1.0, 1.0, sprite_color.a);
vec4 final_color = mix(white_color, sprite_color, color_transition);
final_color.a *= visibility;
COLOR = final_color;
}