ps.1.1 def c0, 0.0f, 0.0f, 0.0f, 0.5f def c1, 0.0f, 0.0f, 0.0f, 0.9f ; sample all the texture stages tex t0 tex t1 tex t2 ; first interpolate the interpolator: using t0 straight produces ghosting ; since the DoF selection is always hi-res (ie, t0) even for the blurred parts. ; playing with various combinations of t0, t1, t2 shows that the following ; is reasonable (depth-changing edges never get really unblurred) ; and yet only takes a single instruction. lrp r0.a, c0, t2.a, t0.a ; although the following also produces good results (but with a bit of ghosting ; and two instructions) ; r0.a = 0.666*(.5*t2.a + .5*t1.a) + 0.333 * t0.a) ; = 0.333*(t0.a+t1.a+t2.a) ; lrp r0.a, c0, t2.a, t1.a ; lrp r0.a, c1, r0.a, t0.a mov r0.rgb, r0.a