Add feature for cursor and range rings

This commit is contained in:
2026-04-05 18:25:42 -07:00
parent 6cf9091c05
commit 337d423639
18 changed files with 779 additions and 284 deletions

View File

@@ -0,0 +1,6 @@
#version 330 core
uniform vec3 uColor;
out vec4 FragColor;
void main() {
FragColor = vec4(uColor, 1.0);
}

View File

@@ -0,0 +1,6 @@
#version 330 core
layout(location = 0) in vec2 aPos;
uniform float uYOffset;
void main() {
gl_Position = vec4(aPos.x, aPos.y + uYOffset, 0.0, 1.0);
}

View File

@@ -0,0 +1,9 @@
#version 330 core
in vec2 vUV;
uniform sampler2D uTexture;
uniform vec3 uColor;
out vec4 FragColor;
void main() {
float alpha = texture(uTexture, vUV).r;
FragColor = vec4(uColor, alpha);
}

View File

@@ -0,0 +1,9 @@
#version 330 core
layout(location = 0) in vec2 aPos;
layout(location = 1) in vec2 aUV;
uniform float uYOffset;
out vec2 vUV;
void main() {
gl_Position = vec4(aPos.x, aPos.y + uYOffset, 0.0, 1.0);
vUV = aUV;
}

6
shaders/ppi_cursor.frag Normal file
View File

@@ -0,0 +1,6 @@
#version 330 core
uniform vec3 uColor;
out vec4 FragColor;
void main() {
FragColor = vec4(uColor, 1.0);
}

5
shaders/ppi_cursor.vert Normal file
View File

@@ -0,0 +1,5 @@
#version 330 core
layout(location = 0) in vec2 aPos;
void main() {
gl_Position = vec4(aPos, 0.0, 1.0);
}

View File

@@ -0,0 +1,6 @@
#version 330 core
in vec3 vColor;
out vec4 fragColor;
void main() {
fragColor = vec4(vColor, 1.0);
}

View File

@@ -0,0 +1,8 @@
#version 330 core
layout(location = 0) in vec2 aPos;
layout(location = 1) in vec3 aColor;
out vec3 vColor;
void main() {
gl_Position = vec4(aPos, 0.0, 1.0);
vColor = aColor;
}

11
shaders/ppi_targets.frag Normal file
View File

@@ -0,0 +1,11 @@
#version 330 core
in vec2 vUV; // [-1,1] range — distance from blob centre
out vec4 fragColor;
uniform vec3 uColor;
uniform float uFalloff; // gaussian width: larger = tighter core
void main() {
float d = length(vUV);
if (d > 1.0) discard;
float intensity = exp(-uFalloff * d * d);
fragColor = vec4(uColor * intensity, intensity);
}

8
shaders/ppi_targets.vert Normal file
View File

@@ -0,0 +1,8 @@
#version 330 core
layout(location = 0) in vec2 aPos;
layout(location = 1) in vec2 aUV;
out vec2 vUV;
void main() {
gl_Position = vec4(aPos, 0.0, 1.0);
vUV = aUV;
}