diff --git a/shaders/texture_loading/glsl/point_line.frag b/shaders/texture_loading/glsl/point_line.frag index c51c141..cc437e2 100644 --- a/shaders/texture_loading/glsl/point_line.frag +++ b/shaders/texture_loading/glsl/point_line.frag @@ -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); } \ No newline at end of file diff --git a/shaders/texture_loading/glsl/point_line.frag.spv b/shaders/texture_loading/glsl/point_line.frag.spv index 0b2c07a..29e4b7a 100644 Binary files a/shaders/texture_loading/glsl/point_line.frag.spv and b/shaders/texture_loading/glsl/point_line.frag.spv differ diff --git a/shaders/texture_loading/glsl/point_line.vert.spv b/shaders/texture_loading/glsl/point_line.vert.spv index 159f607..eb72c72 100644 Binary files a/shaders/texture_loading/glsl/point_line.vert.spv and b/shaders/texture_loading/glsl/point_line.vert.spv differ diff --git a/shaders/texture_loading/glsl/point_line_solid.frag b/shaders/texture_loading/glsl/point_line_solid.frag new file mode 100644 index 0000000..b34cd22 --- /dev/null +++ b/shaders/texture_loading/glsl/point_line_solid.frag @@ -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); +} \ No newline at end of file diff --git a/shaders/texture_loading/glsl/point_line_solid.frag.spv b/shaders/texture_loading/glsl/point_line_solid.frag.spv new file mode 100644 index 0000000..e70baf4 Binary files /dev/null and b/shaders/texture_loading/glsl/point_line_solid.frag.spv differ diff --git a/shaders/texture_loading/glsl/point_line_solid.vert b/shaders/texture_loading/glsl/point_line_solid.vert new file mode 100644 index 0000000..90a467a --- /dev/null +++ b/shaders/texture_loading/glsl/point_line_solid.vert @@ -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; +} \ No newline at end of file diff --git a/shaders/texture_loading/glsl/point_line_solid.vert.spv b/shaders/texture_loading/glsl/point_line_solid.vert.spv new file mode 100644 index 0000000..8cfc36a Binary files /dev/null and b/shaders/texture_loading/glsl/point_line_solid.vert.spv differ