#version 150 in vec3 position; in vec4 color; in float texCoord; uniform mat4 projectionTransform; uniform mat4 viewTransform; uniform mat4 modelTransform; uniform float time; uniform float shimmerStrength; out vec4 vertColor; out float vertTexCoord; float hueMix(float hue, float center) { hue = mod(hue - center + 3.0, 6.0); return min(hue, 1.0) - max(0.0, min(1.0, hue - 3.0)); } vec4 colorWithHue(float hue) { vec4 color; color.r = hueMix(hue, 0.0); color.g = hueMix(hue, 2.0); color.b = hueMix(hue, 4.0); color.a = 1.0; return color; } void main() { vertColor = mix(color, colorWithHue(time), shimmerStrength * 0.25); vertTexCoord = texCoord - fract(time); gl_Position = projectionTransform * viewTransform * modelTransform * vec4(position, 1.0); }