



















































































































	
	
	



































































































;------------------------------------------------------------------------------
; Defines
;------------------------------------------------------------------------------






;------------------------------------------------------------------------------
; Texture coordinates
;------------------------------------------------------------------------------

; Calculate the vertex-to-light vector
add		r6, c10, -r11

; For light attenuation, store scaled and biased vertex-to-light vector in texture stages
mul		r4, r6, c11
mad		oT0.xy, r4.xy, c12, c12
mad		oT1.x, r4.z, c12, c12
mov		oT1.y, c12

; Transform L vector into texture space and store as a texture stage
dp3		oT2.x, r6, r2
dp3		oT2.y, r6, r3
dp3		oT2.z, r6, r1

; Last texture stage is the normal map
mul		oT3.xy, v3, c94
