; DoF pixel shader ps.1.1 /* c0.a focus depth c1.a focus width c3.a bloom */ def c2, 0.5, 0.5, 0.5, 0.5 def c3, 0.0, 0.0, 0.0, 0.1 tex t0 // blurred texture tex t2 // in-focus texture tex t3 // depth map add_x2 r0, -t3, c0 // r0 = depth of field mad r0, r0, r0, c1 // r0 = depth of field^2 + bias dp3_d2 r1, t0, t0 // compute blurred 2*brightness sub_d2 r1.a, r1.a, c3.a add_d2 r1.rgb, t0, t0 // average blurred samples lrp r0.rgb, r0, r1, t2 // lerp between blurred & sharp texture mad r0, r1_sat.a, r1.rgb, r0 // add bloom