Made a "damage indicator" shader; started working on having it toggle

when hit by enemy bullet.
This commit is contained in:
Henry 2025-12-10 16:46:51 +00:00
parent 7ea6f72e72
commit 0791653610
4 changed files with 32 additions and 2 deletions

17
player_hit.gdshader Normal file
View file

@ -0,0 +1,17 @@
shader_type canvas_item;
uniform float toggle;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
COLOR = texture(TEXTURE, UV);
COLOR.r = mix(COLOR.r, abs(sin(TIME * 20.25)), toggle);
}
//void light() {
// // Called for every pixel for every light affecting the CanvasItem.
// // Uncomment to replace the default light processing function with this one.
//}