ps_2_0
// pixel shader to prepare spheres intersection results to receive shadows
// inputs:
// tex1 - shadow test rays origins buffer (result of sphere_shadow_prepare_orig shader)
// c0 - point light position
// c1.x - number of spheres = width of spheres desc texture
// outputs shadow test ray direction
dcl t0
dcl_2d s1
def c6,-128,-128,-128,0
def c5,256,0,0,4
def c7,128,128,128,0
texld r0,t0,s1
mov r1,c6
mad r0,r0,c5.x,r1
sub r0,c0,r0
nrm r1,r0
add r1,r1,c7
rcp r0.x,c5.x
mul r1,r1,r0.x
mov oC0,r1
