













































































































































































































;------------------------------------------------------------------------------
; Vertex transformation
;------------------------------------------------------------------------------

; Transform to projection space
m4x4	oPos, v0, c6

; Compute 1/z
; z/w???
; just 1/w??? this seems to work
dp4 r1.xyzw, v0, c9 ; c6+3
rcp r0, r1

; Copy diffuse 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

mul r0.x, r0.x, c14.y ; scale to 480
mul oPts, r0.x, v13.x
