#version 410 core
layout(location = 0) in vec4 aData; // xz box pos, y seed, w = end (0 bottom, 1 top)
uniform mat4 uVP;
uniform vec3 uCam;
uniform float uTime;
out float vV;   // 0 bottom of streak, 1 top (alpha ramp)
void main() {
    vV = aData.w;
    float H = 26.0, speed = 22.0, streak = 1.4;
    float fall = mod(aData.y - uTime * speed, H);
    float y = uCam.y + (H * 0.5 - fall) + aData.w * streak;
    vec3 w = vec3(floor(uCam.x) + aData.x, y, floor(uCam.z) + aData.z);
    gl_Position = uVP * vec4(w, 1.0);
}
