



















































































































	
	
	



































































































;------------------------------------------------------------------------------
; Defines
;------------------------------------------------------------------------------







;------------------------------------------------------------------------------
; Texture coordinates
;------------------------------------------------------------------------------

; Base texture is the normal map
mul		oT0.xy, v3, c94

; Transform L vector into texture space and store as a texture stage
add		r6, c10, -r11
dp3		oT1.x, r6, r2
dp3		oT1.y, r6, r3
dp3		oT1.z, r6, r1

; Store per-vertex light attenuation in diffuse alpha
dp3		r4.w, r6, r6					
rsq		r6.w, r4.w
dst		r4, r4.wwww, r6.wwww					
dp3		r4.w, r4, c11
rcp		r5.x, r4.w
mul		r6.xyz, r6, r6.w	
dp3		r4.w, r6, -c12				
mad		r4.w, r4.w, c13.x, c13.y
mul		oD0.a, r5.x, r4.w
