阿斯蒂芬

This commit is contained in:
xsl
2025-09-22 00:33:03 +08:00
parent ded9642c4d
commit 51616af8ce
4 changed files with 47 additions and 0 deletions
@@ -0,0 +1,23 @@
#version 450
layout(location = 0) in vec3 inPosition;
layout(location = 1) in vec3 inColor;
layout(location = 0) out vec3 fragColor;
layout(location = 1) out float fragLinePosition; // 用于虚线计算
layout(binding = 0) uniform UniformBufferObject {
mat4 proj;
mat4 model;
mat4 view;
} ubo;
void main() {
mat4 mvp = ubo.proj * ubo.view * ubo.model;
gl_Position = mvp * vec4(inPosition, 1.0);
fragColor = inColor;
gl_PointSize = 2.0;
// 硬编码虚线参数:使用模型空间的X坐标,你可以根据需要调整
fragLinePosition = inPosition.x;
}