f26e329c47
Draw 25000 cubes while doing a uniform buffer update for each. Change-Id: I2216641c8bf7c6ea147fe3edd679317b472e1f04 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
24 lines
493 B
GLSL
24 lines
493 B
GLSL
#version 440
|
|
|
|
layout(location = 0) in vec4 position;
|
|
|
|
layout(location = 0) out vec3 vColor;
|
|
|
|
out gl_PerVertex { vec4 gl_Position; };
|
|
|
|
layout(std140, binding = 0) uniform buf {
|
|
mat4 mvp;
|
|
vec3 translation;
|
|
vec3 color;
|
|
} ubuf;
|
|
|
|
void main()
|
|
{
|
|
vColor = ubuf.color;
|
|
mat4 t = mat4(1, 0, 0, 0,
|
|
0, 1, 0, 0,
|
|
0, 0, 1, 0,
|
|
ubuf.translation.x, ubuf.translation.y, ubuf.translation.z, 1);
|
|
gl_Position = ubuf.mvp * t * position;
|
|
}
|