Created
June 21, 2021 08:34
-
-
Save SabinT/e355bb4646b1c967c69843c3f97934d9 to your computer and use it in GitHub Desktop.
GLSL Time loop tricks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float loopWithPause(float scale) { | |
// sinusoidal, with a short pause at start/end | |
float overshoot = 1.5; | |
// iTime is a variable available in shadertoy.com | |
// Replace with your own variable as needed | |
float t = iTime * scale; // scale time here | |
float a = clamp((mod(t, 2.0) - 1.0) * overshoot, -1.0, 1.0); | |
return sin(a * PI); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment