oculus2_psprite
view sdr/psprite.p.glsl @ 21:dc7af0f549b2
VR point sprite shooting test
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 22 Jan 2015 06:19:52 +0200 |
parents | |
children |
line source
1 #version 120
3 void main()
4 {
5 vec2 pt = gl_PointCoord.xy * 2.0 - 1.0;
6 float len = length(pt);
7 vec2 dir = pt / len;
8 float angle = atan(dir.y, dir.x);
10 float alpha = 1.0 - smoothstep(0.8, 0.9, len + abs(sin(angle * 8.0)) * 0.1);
11 gl_FragColor = vec4(1.0, 1.0, 1.0, alpha);
12 }