1 varying vec4 varColor; 2 varying float pointSize; 3 4 void main() { 5 float dist = ATTRIB_position.y / 4.0; 6 float angle = ATTRIB_position.x; 7 8 float x = dist * sin(angle) * 0.8; 9 float y = dist * cos(angle) * 0.8; 10 float p = dist * 7.5; 11 float s = cos(p); 12 float t = sin(p); 13 vec4 pos; 14 pos.x = t*x + s*y; 15 pos.y = s*x - t*y; 16 pos.z = ATTRIB_position.z; 17 pos.w = 1.0; 18 pos.y = pos.y * 0.5; 19 gl_Position = UNI_MVP * pos; 20 varColor = vec4(1.0, 1.0, 1.0, 1.0); 21 pointSize = 170.0-(pos.y*pos.y*1.2*1.2 + pos.x*pos.x)*400.0; 22 if(pointSize<=30.0){ 23 pointSize = 30.0; 24 } 25 gl_PointSize = pointSize;// - snoise(pos.xy)*5.0; 26 }