ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0 ; base color
texcoord t1
mul r0.rgb, t0_bx2.rgb, c0.rgb + ; Add the refract amount (c0) into the dudv
mov r0.a, t1.a
add_d2 r0.rgb, r0.rgb, c1.rgb ; Rescale back to 0-1
mov_d2 r0.rgb, r0_sat.rgb ; Scale to 0-0.5
mul r0.rgb, r0.rgb, c2 ; Filter out red channel
mad r0.rgb, t1.rgb, c3, r0.rgb ; Red channel contains refracttint monochrome