#version 330 core
// @layer composite
// Wave Distortion — sample custom shader for hot-reload testing.
// Edit this file while the effect is active to see changes in real time.

in vec2 v_texcoord;
out vec4 frag_color;

uniform sampler2D u_input;
uniform vec2 u_resolution;
uniform float u_time;

uniform float u_wave_amount;  // @param min=0.0 max=0.05 default=0.015 step=0.001 label="Wave Amount"
uniform float u_wave_speed;   // @param min=0.5 max=10.0 default=3.0 step=0.1 label="Wave Speed"

void main() {
    vec2 uv = v_texcoord;

    // Horizontal sine wave distortion.
    float wave = sin(uv.y * 25.0 + u_time * u_wave_speed) * u_wave_amount;
    uv.x += wave;

    // Vertical cosine ripple (half strength).
    float ripple = cos(uv.x * 20.0 + u_time * u_wave_speed * 0.7) * u_wave_amount * 0.5;
    uv.y += ripple;

    frag_color = texture(u_input, uv);
}
