/***** This shader captures the essence of slow-motion horse galloping, combined with a serene transition between states. It highlights the gentle beauty of muscle movements, grass-like sways, and subtle energy flows, blending them with seamless transitions that evoke tranquility. *****/ precision mediump float; varying vec2 uv; uniform float time, width, height; // Soft sway effect to mimic a gentle breeze over the grass float gentleGrassSway(vec2 pos, float freq, float amp, float offset) { return sin(pos.y * freq + time * 0.4 + offset) * amp * cos(time * 0.1); } // Adaptation to slow, subtle muscular and grass motion float smoothMuscleAndGrass(vec2 st, vec2 origin, float freq, float intensity, float fade) { float dist = distance(st, origin); float pulse = sin(dist * freq - 0.1 * time + 3.0 * cos(time * 0.4)) * exp(-dist * fade) * 0.75; float swayEffect = gentleGrassSway(st, 6.0, 0.12, dist * 4.0); return intensity * (pulse + swayEffect); } // Impact trails that transition slowly, mirroring gentle hoof impacts float subtleHoofTrail(vec2 st, vec2 impactPoint, float trailIntensity, float trailDissipate) { float distToImpact = distance(st, impactPoint); float trailPattern = smoothstep(0.4, 0.1, distToImpact) * sin(distToImpact * 12.0 - time * 1.5) * 0.5; float swayEffect = gentleGrassSway(st, 8.0, 0.05, distToImpact * 3.0); return (trailPattern + swayEffect) * exp(-distToImpact * trailDissipate) * trailIntensity; } // Combining muscle and grass influences with smooth transitions vec3 smoothTransitionDynamics(vec2 st) { float muscleEnergy1 = smoothMuscleAndGrass(st, vec2(0.3, 0.5), 6.0, 0.25, 2.5); float muscleEnergy2 = smoothMuscleAndGrass(st, vec2(0.7, 0.3), 7.0, 0.25, 2.6); float hoofTrail1 = subtleHoofTrail(st, vec2(0.4, 0.6), 0.6, 1.3); float hoofTrail2 = subtleHoofTrail(st, vec2(0.6, 0.4), 0.6, 1.3); vec3 muscleEnergyCombined = vec3(muscleEnergy1, muscleEnergy2, (muscleEnergy1 + muscleEnergy2) * 0.5); vec3 hoofVibrationCombined = vec3(hoofTrail1, hoofTrail2, 0.4 * (hoofTrail1 + hoofTrail2)); float transitionBlend = smoothstep(0.2, 0.7, sin(time * 0.2)); return mix(muscleEnergyCombined, hoofVibrationCombined, transitionBlend); } // Implementing a slightly slow motion blur to emphasize subtle flow vec3 softMotionBlurEffect(vec2 st, float strength) { vec3 accumulatedColor = vec3(0.0); float blurAmount = 0.08 * strength; for (float i = 0.0; i <= 5.0; i++) { float t = i / 5.0; accumulatedColor += smoothTransitionDynamics(st + vec2(blurAmount * t, 0.0)); } return accumulatedColor / 6.0; } void main() { // Normalize the UV coordinates for square aspect ratio vec2 fragCoord = vec2((uv.x - 0.5) * max(width / height, 1.0) + 0.5, (uv.y - 0.5) * max(height / width, 1.0) + 0.5); // Apply a gentle motion blur to smoothen transitions in the energy pattern vec3 blurredFlow = softMotionBlurEffect(fragCoord, 0.6); // Calculate the output color which emphasizes gentle transitions and tranquility vec3 color = pow(blurredFlow, vec3(1.08)) * 1.12; // Output the shader with a focus on subtle transitions and gentle energy gl_FragColor = vec4(clamp(color, 0.0, 1.0), 1.0); Wind Whisper