|
|
|
#version 330 core
|
|
|
|
|
|
|
|
layout (location = 0) in vec3 vPos;
|
|
|
|
layout (location = 1) in vec3 vColor;
|
|
|
|
layout (location = 2) in float vMassRadius;
|
|
|
|
|
|
|
|
uniform mat3 VP;
|
|
|
|
|
|
|
|
uniform bool drawPoints = false;
|
|
|
|
uniform float screenSizePixels;
|
|
|
|
uniform float screenSizeMeters;
|
|
|
|
uniform float depthOffset;
|
|
|
|
|
|
|
|
out vec3 color;
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
if (drawPoints == true){
|
|
|
|
gl_Position = vec4(VP * vPos, 1.0);
|
|
|
|
gl_Position.z -= depthOffset * 0.5;
|
|
|
|
gl_PointSize = vMassRadius / screenSizeMeters * screenSizePixels * 2;
|
|
|
|
} else {
|
|
|
|
gl_Position = vec4(VP * vPos, 1.0);
|
|
|
|
color = vColor;
|
|
|
|
}
|
|
|
|
}
|