treppe-gl/shaders/ocean.glsl
April John cebb41dbc7 Add fire, ocean, heartbeat, bounce, trans and storm shaders
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 15:03:47 +02:00

17 lines
552 B
GLSL

// Slow waves with white foam on the crests
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
float i = floor(fragCoord.x / iResolution.x * 16.0);
float w = 0.5 + 0.5 * sin(i * 0.55 - iTime * 0.5);
float w2 = 0.5 + 0.5 * sin(i * 0.9 + iTime * 0.35 + 1.0);
float h = 0.6 * w + 0.4 * w2;
vec3 deep = vec3(0.0, 0.05, 0.28);
vec3 shallow = vec3(0.0, 0.55, 0.75);
vec3 col = mix(deep, shallow, h);
float foam = smoothstep(0.82, 0.97, h);
col = mix(col, vec3(0.9), foam * 0.8);
fragColor = vec4(col, 1.0);
}