



















































































































	
	
	



































































































;------------------------------------------------------------------------------
; Geometry transform
;------------------------------------------------------------------------------

; Calculate bone indices 
mad		r7, v14, c23.x, c23.y

; Sum weighted blendshape position deltas
mul     r4, v6, c24.x
mad     r4, v7, c24.y, r4
mad     r4, v8, c24.z, r4
mad     r4, v9, c24.w, r4
mad     r4.xyz, c26.x, r4, v0
mov     r4.w, c1

; Skin position by bone 0
mov	a0.x, r7.x
m4x3	r0.xyz, r4, c[a0.x]	
mul		r11.xyz, r0.xyz, v15.xxx

; Calculate the second bone weight from the first
sub		r8.x, c1, v15.x

; Skin position by bone 1
mov	a0.x, r7.y
m4x3	r0.xyz, r4, c[a0.x]
mad		r11.xyz, r0.xyz, r8.x, r11
mov     r11.w, c1

; Sum weighted blendshape normal deltas
mul     r4, v10, c25.x
mad     r4, v11, c25.y, r4
mad     r4, v12, c25.z, r4
mad     r4, v13, c25.w, r4
mad		r4, c26.x, r4, v1

; Skin normal by bone 0
mov	a0.x, r7.x
m3x3	r1.xyz, r4, c[a0.x]
dp3 r4.w, r1, r1 rsq r1.w, r4.w mul r1.xyz, r1, r1.w

; Transform skinned position to projection space
m4x4	oPos, r11, c6

