projects
/
lighthouse
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clouds and better light beam
[lighthouse]
/
sdr
/
beam.v.glsl
diff --git
a/sdr/beam.v.glsl
b/sdr/beam.v.glsl
index
a823e8b
..
6ea5003
100644
(file)
--- a/
sdr/beam.v.glsl
+++ b/
sdr/beam.v.glsl
@@
-1,9
+1,15
@@
+uniform float beam_len;
+
void main()
{
void main()
{
- float s = gl_Vertex.z + 1.0;
+ float dist = gl_Vertex.z;
+ float s = (dist + 1.0) * 1.6;
vec4 pos = gl_Vertex * vec4(s, s, 1.0, 1.0);
gl_Position = gl_ModelViewProjectionMatrix * pos;
vec4 pos = gl_Vertex * vec4(s, s, 1.0, 1.0);
gl_Position = gl_ModelViewProjectionMatrix * pos;
- gl_FrontColor = gl_Color;
+
+ float d = dist / beam_len;
+ float falloff = min(1.0 - d, 1.0);
+ gl_FrontColor = vec4(gl_Color.xyz, gl_Color.a * falloff);
}
}