I'm doing a simple Image Effect that distorts the image based on a sine function:
fixed4 frag (v2f i) : COLOR
{
//Rotation vars (as used in VortexEffect.shader)
//float cosLength, sinLength;
//sincos (_Angle, sinLength, cosLength);
float2 uv = i.texcoord;
uv += float2(0, sin(uv[0]*_Frequency) * _Amplitude);
float4 texCol = tex2D(_MainTex, uv);
return _Tint * texCol;
}
This distorts the image vertically in a nice sine wave, but how can I change the distortion direction to an arbitrary angle? I've tried looking at the VortexEffect.shader as it has rotation, but haven't been able to translate that to my needs.
/Patrik