John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 1 | #version 420 core
|
| 2 |
|
| 3 | layout(triangles) in;
|
| 4 |
|
| 5 | in gl_PerVertex {
|
| 6 | float gl_PointSize;
|
| 7 | } gl_in[];
|
| 8 |
|
| 9 | out gl_PerVertex {
|
| 10 | float gl_PointSize;
|
| 11 | };
|
| 12 |
|
| 13 | layout(line_strip) out;
|
| 14 | layout(max_vertices = 127) out;
|
| 15 | layout(invocations = 4) in;
|
| 16 |
|
| 17 | uniform sampler2D s2D;
|
| 18 | in vec2 coord[];
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 19 |
|
| 20 | int i;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 21 |
|
| 22 | void 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 | }
|