#version 450 core #pragma include ./shared.glsl #pragma include ../misc/camera.glsl in FragmentData fragmentData; layout (location = 1) uniform vec2 uRings; layout (location = 2) uniform vec2 uMarker; layout (location = 3) uniform vec4 uValue; layout (location = 4) uniform float uProgress; layout (location = 5) uniform float uSize; out vec4 outColor; #pragma include ./shared_frag.glsl void main() { /* setup */ float t_opn = clamp(uProgress, 0.0, 1.0); float t_cls = clamp(uProgress - 1.0, 0.0, 1.0); float r = length(fragmentData.texCoords); float zoom = pow(length(uCamera.view[0].xyz), 0.5); float angle = calcAngle(fragmentData.texCoords, VEC_HORZ); /* marker */ float m = calcMarker(t_opn, angle, r, zoom); /* rings */ float f = calcRingsAnimation(t_opn, angle, 0.1); float t_opn_rad = clamp(2.0 * t_opn, 0.0, 1.0); float value = animLinear(uRings[0], uRings[1], uValue[3]); float r0 = 0.25 * calcRing(t_opn_rad, f, uRings[0], r, zoom); float r1 = 0.25 * calcRing(t_opn_rad, f, uRings[1], r, zoom); float v = 0.75 * calcRing(t_opn_rad, f, value, r, zoom); /* alpha */ float a = calcAlpha(t_opn, t_cls); /* put together */ vec3 rgb = vec3(1.0); outColor = vec4(rgb, (v + r0 + r1 + m) * a + uSize * 0.0001); }