From 611f07a2e6dbfa64c5467022949c7ce938fc09f4 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sat, 16 Apr 2011 17:04:18 +0200 Subject: wip --- shaders/selection_fragment.glsl | 10 ++++++++++ shaders/selection_vertex.glsl | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 shaders/selection_fragment.glsl create mode 100644 shaders/selection_vertex.glsl (limited to 'shaders') 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: */ -- cgit v1.2.3