// water town 1st level
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
//   float4 CameraPositionVS;
//   float3 LightDirection;
//   float4x4 LocalToWorld;
//   float3 TemporalAAParameters;
//   float4x4 ViewProjectionMatrix;
//   float3x3 WorldToLocal;
//
//
// Registers:
//
//   Name                 Reg   Size
//   -------------------- ----- ----
//   ViewProjectionMatrix c0       4
//   CameraPositionVS     c4       1
//   LocalToWorld         c6       4
//   WorldToLocal         c10      3
//   TemporalAAParameters c13      1
//   LightDirection       c14      1
//

    vs_3_0
	def c200, 0, 1, 0.0625, 0	//	0.0625 prime directive reference value	
    def c5, 0.00784313772, -1, 1, 0
    dcl_position v0
    dcl_tangent v1
    dcl_normal v2
    dcl_color1 v3
    dcl_texcoord v4
    dcl_color o0
    dcl_texcoord o1
    dcl_texcoord4 o2.xyz
    dcl_texcoord5 o3
    dcl_texcoord6 o4
    dcl_texcoord7 o5
    dcl_position o6
	dcl_2d s0							// Sampler used to fetch stereo 	
    mad r0.xyz, v1.yzxw, c5.x, c5.y
    mad r1, v2, c5.x, c5.y
    mul r2.xyz, r0, r1.zxyw
    mad r0.xyz, r1.yzxw, r0.yzxw, -r2
    mul r0.xyz, r1.w, r0
    mul r2.xyz, r1.yzxw, r0.zxyw
    mad r2.xyz, r0.yzxw, r1.zxyw, -r2
    mul r2.xyz, r1.w, r2
    mov r3.xyz, c14
    mul r4.xyz, r3.y, c11
    mad r3.xyw, c10.xyzz, r3.x, r4.xyzz
    mad r3.xyz, c12, r3.z, r3.xyww
    dp3 o2.x, r2, r3
    dp3 o2.y, r0, r3
    dp3 o2.z, r1, r3
    mul r3, c7, v0.y
    mad r3, c6, v0.x, r3
    mad r3, c8, v0.z, r3
    mad r3, c9, v0.w, r3
    mul r4, r3.y, c1
    mad r4, c0, r3.x, r4
    mad r4, c2, r3.z, r4
    mad r4, c3, r3.w, r4
    mul r0.w, r4.w, c13.z
    mad o6.xy, r0.w, c13, r4
    mov o6.zw, r4
    mad r4.xyz, r3, -c4.w, c4
//    mov o5, r3
    mul r3.xyz, r4.y, c11
    mad r3.xyz, c10, r4.x, r3
    mad r3.xyz, c12, r4.z, r3
    dp3 o4.x, r2, r3
    dp3 o4.y, r0, r3
    dp3 o4.z, r1, r3
    mov o0, v3
    mul o1, c5.zzww, v4.xyxx
    mov o3, c5.w
    mov o4.w, c5.z
	
mov r0, r3				// move r3 to r0
// At this point r0 is the output position, correctly
// placed, but without stereo.
 
// To create stereo effects, we need to calculate:
//  Xnew = Xold + Separation * (W - Convergence)
 
// Fetch the Separation (r30.x) and Convergence (r30.y)  
// using the Helix NVapi trick
texldl r30, c200.z, s0
 
// (W - Convergence)
add r30.w, r0.w, -r30.y
 
// multiply that times Separation for:
//   Separation * (W - Convergence)
mul r30.z, r30.x, r30.w
 
// Add that to Xold for the complete:
//  Xold + Separation * (W - Convergence)
add r0.x, r0.x, r30.z
		
mov o5, r0				// move fixed r3 (r0) into o5		

// approximately 38 instruction slots used
 