diff options
| author | nokoe <nokoe@mailbox.org> | 2024-06-22 21:43:35 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-06-23 19:30:15 +0200 |
| commit | e468cf085e0b23b3c5b359a672fccc6b8b7d4fc2 (patch) | |
| tree | afac68d560c2b02c5000b183921e2000b1d703d4 /client/textures | |
| parent | 2c5ced9a026012ef8fe890ff006d261148ce70f1 (diff) | |
| download | hurrycurry-e468cf085e0b23b3c5b359a672fccc6b8b7d4fc2.tar hurrycurry-e468cf085e0b23b3c5b359a672fccc6b8b7d4fc2.tar.bz2 hurrycurry-e468cf085e0b23b3c5b359a672fccc6b8b7d4fc2.tar.zst | |
marker
Diffstat (limited to 'client/textures')
| -rw-r--r-- | client/textures/interact_marker.gdshader | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/client/textures/interact_marker.gdshader b/client/textures/interact_marker.gdshader new file mode 100644 index 00000000..dccaf17d --- /dev/null +++ b/client/textures/interact_marker.gdshader @@ -0,0 +1,17 @@ +shader_type spatial; + +uniform float max_width = .1; +uniform float marker_length = .5; +uniform float pulse_speed = 4.; + +void fragment() { + ALBEDO = vec3(15., 0., 0.); + vec2 uv = abs(2. * UV.xy - 1.); + float m_length = marker_length / max_width; + float anim = sin(TIME * pulse_speed) * .5 + 1.; + float alpha = step( + 1. - max_width * anim, max(uv.x, uv.y)) + * step(1. - max_width * m_length, min(uv.x, uv.y) + ); + ALPHA = alpha; +} |