Support the #extension GL_ARB_draw_instanced.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
This commit is contained in:
parent
eb92526d5e
commit
46d3a30bd9
5 changed files with 212 additions and 1 deletions
18
Test/GL_ARB_draw_instanced.vert
Normal file
18
Test/GL_ARB_draw_instanced.vert
Normal file
|
|
@ -0,0 +1,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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue