triangle.frag
#version 400
out vec4 fragColor;
uniform float fragLoopDuration;
uniform float time;
const vec4 firstColor =vec4(1.0f, 0.0f, 0.0f, 1.0f);
const vec4 secondColor =vec4(0.0f, 1.0f, 0.0f, 1.0f);
void main(){
float currentTime =mod(time, fragLoopDuration);
float currentLerp =currentTime/fragLoopDuration;
fragColor =mix(firstColor, secondColor, currentLerp);
}