fix jarring color jump in hex shimmer: sawtooth → triangle wave
This commit is contained in:
parent
e660c8c868
commit
e928688aa4
1 changed files with 2 additions and 1 deletions
|
|
@ -77,7 +77,8 @@ void main() {
|
||||||
if (wf > 0.01 && edgeFactor > 0.0) {
|
if (wf > 0.01 && edgeFactor > 0.0) {
|
||||||
// Vary shimmer color across theme gradient using angle + position
|
// Vary shimmer color across theme gradient using angle + position
|
||||||
float angle = atan(p.y, p.x);
|
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);
|
vec3 shimmerColor = themeGradient(t);
|
||||||
|
|
||||||
float shimmer = edgeFactor * wf;
|
float shimmer = edgeFactor * wf;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue