File: GL_ARB_draw_instanced.vert

package info (click to toggle)
glslang 16.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,712 kB
  • sloc: cpp: 92,305; yacc: 4,320; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (18 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#version 150
#extension GL_ARB_draw_instanced : require
#define ID gl_InstanceID

uniform mat4 gtf_ModelViewProjectionMatrix;
uniform vec3 instanceOffsets[3];
in vec4 va[gl_MaxVertexAttribs];
out vec4 color;

void main (void)
{
        vec4 vertex = vec4(va[0].xy / 3.0, va[0].zw) + vec4(instanceOffsets[ID], 1.0);
        color = vec4(0, 0, 0, 0);
        for (int i = 1; i < gl_MaxVertexAttribs; i++)
                color += va[i];
        gl_Position = gtf_ModelViewProjectionMatrix * vertex;
        gl_PointSize = 1.0;
}