#version 450
/*
 * Copyright 2023 TU Wien, Institute of Visual Computing & Human-Centered Technology.
 * This file is part of the GCG Lab Framework and must not be redistributed.
 *
 * Original version created by Lukas Gersthofer and Bernhard Steiner.
 * Vulkan edition created by Johannes Unterguggenberger (junt@cg.tuwien.ac.at).
 */

layout (location = 0) in vec3 in_position;
layout (location = 1) in float in_size;
layout (location = 2) in vec4 in_color;

layout (binding = 0) uniform UniformBuffer {
	mat4 viewProjMatrix;
} ub_data;

layout (location = 0) out vec4 out_color;

void main() {
	gl_Position = ub_data.viewProjMatrix * vec4(in_position, 1);
	float dist = abs(gl_Position.z);
	gl_PointSize = in_size / dist;
	out_color = in_color;
}
