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.

45 lines
1.4 KiB

  1. #version 450 core
  2. #pragma include ./shared.glsl
  3. #pragma include ../misc/camera.glsl
  4. in FragmentData fragmentData;
  5. layout (location = 1) uniform vec2 uRings;
  6. layout (location = 2) uniform vec2 uMarker;
  7. layout (location = 3) uniform vec4 uValue;
  8. layout (location = 4) uniform float uProgress;
  9. layout (location = 5) uniform float uSize;
  10. out vec4 outColor;
  11. #pragma include ./shared_frag.glsl
  12. void main() {
  13. /* setup */
  14. float t_opn = clamp(uProgress, 0.0, 1.0);
  15. float t_cls = clamp(uProgress - 1.0, 0.0, 1.0);
  16. float r = length(fragmentData.texCoords);
  17. float zoom = pow(length(uCamera.view[0].xyz), 0.5);
  18. float angle = calcAngle(fragmentData.texCoords, VEC_HORZ);
  19. /* marker */
  20. float m = calcMarker(t_opn, angle, r, zoom);
  21. /* rings */
  22. float f = calcRingsAnimation(t_opn, angle, 0.1);
  23. float t_opn_rad = clamp(2.0 * t_opn, 0.0, 1.0);
  24. float value = animLinear(uRings[0], uRings[1], uValue[3]);
  25. float r0 = 0.25 * calcRing(t_opn_rad, f, uRings[0], r, zoom);
  26. float r1 = 0.25 * calcRing(t_opn_rad, f, uRings[1], r, zoom);
  27. float v = 0.75 * calcRing(t_opn_rad, f, value, r, zoom);
  28. /* alpha */
  29. float a = calcAlpha(t_opn, t_cls);
  30. /* put together */
  31. vec3 rgb = vec3(1.0);
  32. outColor = vec4(rgb, (v + r0 + r1 + m) * a + uSize * 0.0001);
  33. }