oculus2_psprite

annotate 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
rev   line source
nuclear@21 1 #version 120
nuclear@21 2
nuclear@21 3 void main()
nuclear@21 4 {
nuclear@21 5 vec2 pt = gl_PointCoord.xy * 2.0 - 1.0;
nuclear@21 6 float len = length(pt);
nuclear@21 7 vec2 dir = pt / len;
nuclear@21 8 float angle = atan(dir.y, dir.x);
nuclear@21 9
nuclear@21 10 float alpha = 1.0 - smoothstep(0.8, 0.9, len + abs(sin(angle * 8.0)) * 0.1);
nuclear@21 11 gl_FragColor = vec4(1.0, 1.0, 1.0, alpha);
nuclear@21 12 }