















































































































































































































;------------------------------------------------------------------------------
; Vertex transformation
;------------------------------------------------------------------------------

; Transform to projection space
m4x4	r0, v0, c6

; Adjust for aspect ratio
mul     r4, v13, c15
; Add in the appropriate billboard vectors
; (These are already transformed into projection space)

mad     r0, r4.x, c10, r0
mad     oPos, r4.y, c14, r0

;------------------------------------------------------------------------------
; Lighting calculation
;------------------------------------------------------------------------------

; Combine vertex color and material color
mul		oD0, v2, c2

; Calculate fog factor
add r7, c51, -v0 dp3 r4.x, r7, r7 rsq r4.x, r4.x rcp r4.x, r4.x mad r4.x, r4.x, c4.x, c4.y dp4 r4.y, v0, c52 mad r4.y, r4.y, c4.z, c4.w min oFog, r4.x, r4.y


;------------------------------------------------------------------------------
; Texture coordinates
;------------------------------------------------------------------------------

; Copy base tex coords
mov		oT0.xy, v3
