summaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'shaders')
-rw-r--r--shaders/selection_fragment.glsl10
-rw-r--r--shaders/selection_vertex.glsl15
2 files changed, 25 insertions, 0 deletions
diff --git a/shaders/selection_fragment.glsl b/shaders/selection_fragment.glsl
new file mode 100644
index 0000000..33b6cf1
--- /dev/null
+++ b/shaders/selection_fragment.glsl
@@ -0,0 +1,10 @@
+#version 120
+
+uniform sampler2D tex;
+uniform float dist;
+
+void main() {
+ vec4 tc = texture2D(tex, gl_TexCoord[0].st);
+ gl_FragColor = tc * gl_Color * .3;
+}
+/* vim: set syn=glsl: */
diff --git a/shaders/selection_vertex.glsl b/shaders/selection_vertex.glsl
new file mode 100644
index 0000000..b5f0aa7
--- /dev/null
+++ b/shaders/selection_vertex.glsl
@@ -0,0 +1,15 @@
+#version 120
+
+uniform float dist;
+
+void main() {
+ gl_PointSize = min(200/dist * log(gl_Vertex.w+2), 200);
+ gl_FrontColor = vec4(1, gl_Vertex.w/2, 0, 1);
+
+ gl_PointSize = 100/dist * min(gl_Vertex.w+.5, 1);
+ gl_FrontColor = vec4(1, 1-log(gl_Vertex.w+1.0), 0, 1);
+
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(gl_Vertex.xyz, 1);
+}
+/* vim: set syn=glsl: */