Made a "damage indicator" shader; started working on having it toggle
when hit by enemy bullet.
This commit is contained in:
parent
7ea6f72e72
commit
0791653610
4 changed files with 32 additions and 2 deletions
17
player_hit.gdshader
Normal file
17
player_hit.gdshader
Normal 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.
|
||||
//}
|
||||
Loading…
Add table
Add a link
Reference in a new issue