#version 450 layout(location = 0) in vec4 point; layout(location = 0) out float thickness; layout(push_constant) uniform PushConstants { mat4 MVP; vec4 Color; vec4 BGCol; float Ratio; float Target; } pc; void main() { thickness = point.w; vec4 vec = pc.MVP * vec4(point.xyz, 1.0); vec.z *= vec.w; // Remap OpenGL clip Z [-w, w] to Vulkan [0, w] after the depth trick above. vec.z = (vec.z + vec.w) * 0.5; gl_Position = vec; }