diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-04-16 17:04:18 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-04-16 17:04:18 +0200 |
commit | 611f07a2e6dbfa64c5467022949c7ce938fc09f4 (patch) | |
tree | 81cb072f4694bca30aee657430a46c12284ce7be /shaders | |
parent | 0986cf8f33df8926dd8da67f98ed18f696141313 (diff) |
wipparticles
Diffstat (limited to 'shaders')
-rw-r--r-- | shaders/selection_fragment.glsl | 10 | ||||
-rw-r--r-- | shaders/selection_vertex.glsl | 15 |
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: */ |