ps_2_0
// create noise
// input
//   c0 - random constants
//   c1.x - -1,0
//   tex0 - rt
dcl t0
dcl_2d s0
mul r0,c0,t0
mul r2,t0,t0
mul r0.z,c0.z,r2.x
mul r0.w,c0.w,r2.y
add r0.x,r0.x,r0.y
add r0.x,r0.x,r0.z
add r0.x,r0.x,r0.w
frc r2.z,r0.x
mul r0.x,c0.x,r2.z
mul r0.y,c0.y,r2.x
mul r0.z,c0.z,r2.z
mul r0.w,c0.w,r2.y
add r0.x,r0.x,r0.y
add r0.x,r0.x,r0.z
add r0.x,r0.x,r0.w
texld r1,t0,s0
mul r1.x,r0.x,r1.x
cmp r0.x,c1.x,r1.x,r0.x
frc r0.x,r0.x
mov r0,r0.x
mov oC0,r0
