Files
openroller/apps/desktop/shaders/line.vert
T
tsuki 831d96e562 Initial public source release
Split reusable rendering and format support into vectorail-core and vectorail-gc.
2026-08-02 17:05:27 +02:00

26 lines
664 B
GLSL

#version 450 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in float aSide;
layout (location = 2) in vec3 aRight;
layout (location = 3) in float aTimeMs;
uniform mat4 uProjection;
uniform mat4 uView;
uniform float uWidth;
out float vSide;
out float vDist;
out float vTrackTimeMs;
void main() {
vSide = aSide;
vTrackTimeMs = aTimeMs;
vec3 finalPos = aPos + aRight * aSide * uWidth;
// Считаем позицию в пространстве камеры
vec4 viewPos = uView * vec4(finalPos, 1.0);
vDist = -viewPos.z; // Глубина (дистанция от камеры)
gl_Position = uProjection * viewPos;
}