24 lines
464 B
GLSL
24 lines
464 B
GLSL
#version 450
|
|
#extension GL_ARB_separate_shader_objects : enable
|
|
|
|
layout(set = 0, binding = 0) uniform NodeData
|
|
{
|
|
mat4 world;
|
|
} node;
|
|
|
|
layout(set = 1, binding = 0) uniform CameraData
|
|
{
|
|
mat4 viewProjection;
|
|
} cam;
|
|
|
|
layout(location = 0) out vec4 color;
|
|
|
|
void main()
|
|
{
|
|
int i = gl_VertexIndex & -2;
|
|
color = vec4(i == 0, i == 2, i == 4, 1);
|
|
vec4 position = color * (gl_VertexIndex & 1);
|
|
position.w = 1;
|
|
gl_Position = cam.viewProjection * node.world * position;
|
|
}
|