Wavebottom frame from Corner Gas

This shader makes the bottom portion of the frame (defined by the split variable, gently waving up and down by default) a wavy reflection of the top part composited with the unfiltered bottom part, with both frequency and opacity of the wavy reflection becoming less pronounced towards the bottom of the frame.

sampler s0 : register(s0);
float4 p0 : register(c0);

#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])

float4 main(float2 tex : TEXCOORD0) : COLOR
{
    float split = 0.7+0.05*sin(clock/0.8); //border between real and reflection
    float diff = tex.y - split; //distance from split
    float shift = .005*sin(50*diff/tex.y)+.1*diff*sin(clock/0.8); //horizontal
    if (diff 

This shader was made to use with Media Player Classic.