fix jarring color jump in hex shimmer: sawtooth → triangle wave

This commit is contained in:
Damocles 2026-04-13 21:34:34 +02:00
parent e660c8c868
commit e928688aa4

View file

@ -77,7 +77,8 @@ void main() {
if (wf > 0.01 && edgeFactor > 0.0) {
// Vary shimmer color across theme gradient using angle + position
float angle = atan(p.y, p.x);
float t = fract((angle + 3.14159) / 6.28318 + center.x * 0.003 + center.y * 0.005);
float rawT = fract((angle + 3.14159) / 6.28318 + center.x * 0.003 + center.y * 0.005);
float t = abs(rawT * 2.0 - 1.0); // triangle wave → uC0→uC1→uC2→uC1→uC0, no hard jump
vec3 shimmerColor = themeGradient(t);
float shimmer = edgeFactor * wf;