#version 450

layout(location = 0) in vec3 inPosition;
layout(location = 1) in vec3 inColor;

layout(location = 0) out vec3 fragColor;

layout(binding = 0) uniform UniformBufferObject {
    mat4 proj;
    mat4 model;
    mat4 view;
} ubo;

void main() {
    // 预计算MVP矩阵以减少乘法次数
    mat4 mvp = ubo.proj * ubo.view * ubo.model;
    //vec3 pos = vec3(2.0, inPosition.y, inPosition.z);
    gl_Position = mvp * vec4(inPosition, 1.0);
    fragColor = inColor;
    gl_PointSize = 2.0;
}