mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:45:33 +00:00
46 lines
No EOL
1.2 KiB
Text
46 lines
No EOL
1.2 KiB
Text
shader_type spatial;
|
|
|
|
render_mode unshaded, cull_disabled;
|
|
|
|
//uniform bool active = false;
|
|
//uniform vec4 flash_color: source_color = vec4(1.0, 0.2, 0.2, 1.0);
|
|
//uniform sampler2D tex: source_color;
|
|
uniform sampler2D tex : source_color, filter_nearest;
|
|
|
|
uniform vec4 blink_color : source_color = vec4(1.0, 0.2, 0.2, 1.0);
|
|
uniform float blink_intensity = 0.0;
|
|
uniform float teleport_progress = 0.0;
|
|
uniform float scanline_density = 50.0;
|
|
|
|
void fragment() {
|
|
|
|
vec4 color = texture(tex, UV);
|
|
|
|
// Apply blink effect based on alpha
|
|
color = mix(color, blink_color, blink_intensity * color.a);
|
|
|
|
// Scanline effect: horizontal lines that control alpha
|
|
float scanline = mod(UV.y * scanline_density, 1.0);
|
|
float cutoff = smoothstep(0.0, 1.0, UV.y - teleport_progress);
|
|
float alpha_multiplier = step(scanline, cutoff);
|
|
color.a *= alpha_multiplier;
|
|
|
|
// Determine final output
|
|
/*if (active) {
|
|
ALBEDO = flash_color.rgb;
|
|
} else {
|
|
ALBEDO = color.rgb;
|
|
}*/
|
|
ALBEDO = color.rgb;
|
|
ALPHA = color.a;
|
|
/*
|
|
if (active) {
|
|
vec4 color = texture(tex, UV);
|
|
ALPHA = color.a;
|
|
ALBEDO = vec3(flash_color.r, flash_color.g, flash_color.b);
|
|
} else {
|
|
vec4 color = texture(tex, UV);
|
|
ALPHA = color.a;
|
|
ALBEDO = vec3(color.r, color.g, color.b);
|
|
}*/
|
|
} |