; Single instruction to send the accumulated light ; colors and alpha to the output register. ; Calculates just the reflect vector for environment mapping #pragma screenspace xvs.1.1 mov r5, LOCAL_EYE_POINT sub r5.xyz, r10.xyz, r5.xyz ;r5 = View Vec (Eye->Coord) dp3 r5.w, r5, r5 ; (normalize R5) rsq r5.w, r5.w mul r5, r5, r5.w ;r5 = Normalized View Vec (Eye->Coord) dp3 r1, r5, r9 ;r1 = (E dot N) mul r2, r1, r9 ;r1 = (E dot N)*N add r1, r2, r2 ;r1 = 2*(E dot N)*N sub r5.xyz, r5.xyz, r1.xyz ;r5 = E - 2*(E dot N)*N ; translate the reflected eye vector into clipping space ; This is a directional vector- do not add matrix translation mul r1, r5.x, L2W_MATRIX1 mad r2, r5.y, L2W_MATRIX2, r1 mad r3, r5.z, L2W_MATRIX3, r2 mov oT2, -r3 ;Send out reflect vector! mul oT3.xy, v1, UVSCALE3 ;Make sure I get the spec-map UV's!