You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
644 B
28 lines
644 B
1 year ago
|
#version 330 core
|
||
|
|
||
1 year ago
|
layout (location = 0) in vec3 vPos;
|
||
1 year ago
|
layout (location = 1) in vec3 vColor;
|
||
1 year ago
|
layout (location = 2) in float vMassRadius;
|
||
1 year ago
|
|
||
1 year ago
|
uniform mat3 VP;
|
||
|
|
||
1 year ago
|
uniform bool drawPoints;
|
||
1 year ago
|
uniform int simulationSizePixels;
|
||
|
uniform float simulationSizeMeters;
|
||
1 year ago
|
uniform float depthOffset;
|
||
1 year ago
|
|
||
1 year ago
|
out vec3 color;
|
||
|
|
||
|
void main() {
|
||
1 year ago
|
gl_Position = vec4(VP * vPos, 1.0);
|
||
|
if (drawPoints){
|
||
1 year ago
|
// Points always on top of neighbouring lines
|
||
1 year ago
|
gl_Position.z -= depthOffset * 0.5;
|
||
1 year ago
|
|
||
|
// PointSize is diameter in Pixels
|
||
|
gl_PointSize = vMassRadius / simulationSizeMeters * simulationSizePixels * 2;
|
||
1 year ago
|
} else {
|
||
|
color = vColor;
|
||
|
}
|
||
1 year ago
|
}
|