1#version 420 core 2 3layout(triangles) in; 4 5in gl_PerVertex { 6 float gl_PointSize; 7} gl_in[]; 8 9out gl_PerVertex { 10 float gl_PointSize; 11}; 12 13layout(line_strip) out; 14layout(max_vertices = 127) out; 15layout(invocations = 4) in; 16 17uniform sampler2D s2D; 18in vec2 coord[]; 19 20int i; 21 22void main() 23{ 24 float p = gl_in[1].gl_PointSize; 25 gl_PointSize = p; 26 gl_ViewportIndex = 7; 27 28 EmitStreamVertex(1); 29 EndStreamPrimitive(0); 30 EmitVertex(); 31 EndPrimitive(); 32 int id = gl_InvocationID; 33 34 const ivec2 offsets[5] = 35 { 36 ivec2(0,1), 37 ivec2(1,-2), 38 ivec2(0,3), 39 ivec2(-3,0), 40 ivec2(2,1) 41 }; 42 vec4 v = textureGatherOffset(s2D, coord[0], offsets[i].xy); 43} 44