










































































































































vs.1.0

;------------------------------------------------------------------------------
; Defines
;------------------------------------------------------------------------------




;------------------------------------------------------------------------------
; Vertex transformation
;------------------------------------------------------------------------------

; Transform to projection space
m4x4	oPos, v0, c6


;------------------------------------------------------------------------------
; Lighting calculation
;------------------------------------------------------------------------------

; Compute the normalized vertex to eye vector
add		r7, c10, -v0
dp3 r4.w, r7, r7 rsq r7.w, r4.w mul r7.xyz, r7, r7.w

; Dot with vertex normal and take absolute value
dp3		r5.x, v1, r7
max		r5.x, r5.x, -r5.x
mad     r5.x, r5.x, c11.x, c11.y
max		r5.x, r5.x, c0.x

; Modulate with constant diffuse
mov     oD0.rgb, c2.rgb
mul		oD0.a, r5.x, c2.a

; Calculate fog factor
dp4 r4, v0, c9 mad oFog.x, r4.x, c4.x, c4.y

;------------------------------------------------------------------------------
; Texture coordinates
;------------------------------------------------------------------------------

; Copy base tex coords
mov		oT0.xy, v3
