Files
Vulkan-Samples/shaders/texture_loading/glsl/pointcloud.vert
T
2025-09-24 22:20:07 +08:00

24 lines
560 B
GLSL

#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);
gl_Position = vec4(inPosition.xy*2 -1, 0.5, 1.0);
fragColor = inColor;
gl_PointSize = 2.0;
}