25 lines
414 B
GLSL
25 lines
414 B
GLSL
#version 450
|
|
#extension GL_GOOGLE_include_directive : enable
|
|
|
|
#include "lib/common.glsl"
|
|
|
|
CAMERA(0, camera)
|
|
STORAGE_BUFFER(1, Object, objects)
|
|
|
|
IN(0, vec3, position)
|
|
IN(1, vec4, color)
|
|
OUT(0, vec3, color)
|
|
|
|
out gl_PerVertex
|
|
{
|
|
vec4 gl_Position;
|
|
};
|
|
|
|
void main()
|
|
{
|
|
out_color = in_color.rgb;
|
|
|
|
mat4 mvp = camera.ViewProj * objects.item[gl_InstanceIndex].model;
|
|
gl_Position = mvp * vec4(in_position, 1);
|
|
}
|