diff options
| author | nokoe <nokoe@mailbox.org> | 2024-06-23 13:06:22 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-06-23 19:32:37 +0200 |
| commit | b9804603ca520fad268060ac802cec6f27d60782 (patch) | |
| tree | 162c5a68db4f394c458fc82926ce376653ad8e87 /client/textures | |
| parent | dfa843547f6e12309854269ac3fe552afe0054ca (diff) | |
| download | hurrycurry-b9804603ca520fad268060ac802cec6f27d60782.tar hurrycurry-b9804603ca520fad268060ac802cec6f27d60782.tar.bz2 hurrycurry-b9804603ca520fad268060ac802cec6f27d60782.tar.zst | |
indicate interactive with marker
Diffstat (limited to 'client/textures')
| -rw-r--r-- | client/textures/interact_marker.gdshader | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/client/textures/interact_marker.gdshader b/client/textures/interact_marker.gdshader index dccaf17d..94b7323d 100644 --- a/client/textures/interact_marker.gdshader +++ b/client/textures/interact_marker.gdshader @@ -3,12 +3,22 @@ shader_type spatial; uniform float max_width = .1; uniform float marker_length = .5; uniform float pulse_speed = 4.; +uniform bool interactive = false; void fragment() { - ALBEDO = vec3(15., 0., 0.); + if (interactive) { + ALBEDO = vec3(15., 0., 0.); + } else { + ALBEDO = vec3(.1, .1, .1); + } vec2 uv = abs(2. * UV.xy - 1.); float m_length = marker_length / max_width; - float anim = sin(TIME * pulse_speed) * .5 + 1.; + float anim; + if (interactive) { + anim = sin(TIME * pulse_speed) * .5 + 1.; + } else { + anim = .5; + } float alpha = step( 1. - max_width * anim, max(uv.x, uv.y)) * step(1. - max_width * m_length, min(uv.x, uv.y) |