MagicNStuff/game/assets/shaders/rhythm/beating_lightbeam.gdshader

25 lines
798 B
Plaintext

shader_type spatial;
render_mode unshaded, shadows_disabled, cull_disabled;
#include "uid://cy7b01or0ckgk" // Rhythm Helper
uniform vec3 color: source_color = vec3(1.0, 1.0, 1.0);
uniform float alpha_multiplier: hint_range(0.0, 1.0, 0.001) = 0.25;
uniform sampler2D albedo;
uniform float flash_exponent = 3.0;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
float phase = get_beat_phase();
vec4 tex = texture(albedo, UV);
ALBEDO = mix(tex.rgb, color.rgb, 0.5);
ALPHA = tex.a * ease(1.0 - phase, flash_exponent) * alpha_multiplier;//mix(tex.a, color.a * (1.0 - phase), 0.5);
}
//void light() {
// // Called for every pixel for every light affecting the material.
// // Uncomment to replace the default light processing function with this one.
//}