ps.1.1
//tex t0
//tex t1
//tex t2


def	c3,1,1,1,1

	tex t0      ; Base
	tex t1      ; Normal
	tex t2      ; Cubic Normalized Tangent Space Light Direction
	tex t3      ; Cubic Normalized Tangent Space Halfangle vector

	dp3_sat r1, t1_bx2, t3_bx2  ; N.H
	dp3_sat r0.rgb, t1_bx2, t2_bx2  ; N.L
	+mul     r0.a, r1.a, r1.a    ; N.H^2
	mad 	r0.rgb,r0,v0,c0
	+mul    r0.a, r0.a, r0.a    ; N.H^2

	mad	r0.rgb,c3,t0.aaa,r0
	+mul     r0.a, r0.a, r0.a    ; N.H^4

	mul     r0.rgb, r0, t0      ; base * (ambient + N.L))
	+mul     r0.a, r0.a, r0.a    ; N.H^16

	mul     r1, 1-t1.a, r0.a    ; Gloss map * specular highlight
	mad     r0.rgb,r1,c1,r0


//	mad	r0.rgb,t0,t0.aaa,r0

