实线画出来了。

This commit is contained in:
xsl
2025-09-22 19:14:14 +08:00
parent cb59a5c1c8
commit 610537fe9d
7 changed files with 42 additions and 5 deletions
+8 -5
View File
@@ -3,7 +3,7 @@
layout(location = 0) in vec3 fragColor;
layout(location = 1) in vec3 fragSegmentStart;
layout(location = 2) in vec3 fragSegmentEnd;
layout(location = 3) in vec3 fragWorldPos;
//layout(location = 3) in vec3 fragWorldPos;
layout(location = 0) out vec4 outColor;
@@ -56,9 +56,12 @@ void main() {
currentPos);
// 如果alpha接近0,直接丢弃片元
if (alpha < 0.01) {
discard;
}
outColor = vec4(fragColor, alpha);
// if (alpha < 0.01) {
// discard;
// }
// outColor = vec4(fragColor, alpha);
outColor = vec4(1, 0, 0, 1.0);
}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
#version 450
layout(location = 0) in vec3 fragColor;
layout(location = 0) out vec4 outColor;
void main() {
outColor = vec4(1, 0, 0, 1.0);
}
@@ -0,0 +1,23 @@
#version 450
layout(location = 0) in vec3 inPosition;
layout(location = 1) in vec3 inColor;
layout(location = 2) in vec3 inLineStart;
layout(location = 3) in vec3 inLineEnd;
layout(location = 0) out vec3 fragColor;
layout(binding = 0) uniform UniformBufferObject {
mat4 proj;
mat4 model;
mat4 view;
} ubo;
void main() {
//mat4 worldviewproj = ubo.proj * ubo.view * ubo.model;
mat4 mvp = ubo.proj * ubo.view * ubo.model;
//gl_Position = worldviewproj * vec4(inPosition, 1.0);
gl_Position = mvp * vec4(inPosition, 1.0);
fragColor = inColor;
}