
instances( 15 )

lighting()

regc( 1, "FOG_PARAMS" )
regcn( 6, "CONST_PALETTE", 90 )


regi(0, "float4", "SS_POSITION")
regi(1, "float3", "SS_NORMAL")
regi(2, "float2", "SS_TEXCOORD0")
regi(3, "float2", "SS_TEXCOORD1")

vshader("

	vs.1.1

	def 	c5, 0.0, 0.2, 0.2, 0.0
	def	c0, 1, 0, 0, 0.5

	mov	a0.x, v0.w

	mad	r1, v0, c0.xxxy, c0.yyyx

	dp4	oPos.x, r1, c[6 + a0.x]
	dp4	oPos.y, r1, c[7 + a0.x]
	dp4	oPos.z, r1, c[8 + a0.x]
	dp4	oPos.w, r1, c[9 + a0.x]

	dp4	r0.x, r1, c[8 + a0.x]
	mad	oFog.x, r0.x, c1.x, c1.y

    dp3	r1.xyz, v1, c[11 + a0.x]
    max	r1.xyz, r1, c5.xxx
    mul r1.xyz, r1, c[10 + a0.x]
    add	r1.xyzw, r1.xyzz, c5.yyyy
    min	oD0.xyzw, r1.xyzw, c0.xxxx

	mov	oT0.xy, v2
	mov	oT1.xy, v3
")
