//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.15 on Mon Mar 11 09:54:31 2019
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 vEye;                       // Offset:    0 Size:    16
//   row_major float4x4 mW2P;           // Offset:   16 Size:    64
//   float4 ksgClipPlane[6];            // Offset:   80 Size:    96
//   float4 vNormalParam;               // Offset:  176 Size:    16
//   float3 vNormalNoiseParam;          // Offset:  192 Size:    12
//   float4 vHeightMaskUV;              // Offset:  208 Size:    16
//   float fWaterLevel;                 // Offset:  224 Size:     4
//   float4 vWaveDirect;                // Offset:  240 Size:    16
//   float4 vWaveParameter;             // Offset:  256 Size:    16
//   float4 vWaveParameter2;            // Offset:  272 Size:    16
//   float4 vWaveFigure;                // Offset:  288 Size:    16
//   float4 vWaveNoiseTextureParam;     // Offset:  304 Size:    16
//   float4 vShoreBubbleParam;          // Offset:  320 Size:    16
//   float4 vBubbleShoalingAjustParam;  // Offset:  336 Size:    16
//   float4 vCameraDirXZ;               // Offset:  352 Size:    16
//   float fShoalingScale;              // Offset:  368 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// __smpsOceanHeightMask             sampler      NA          NA    0        1
// __smpsOceanHorizontalDisplacementMap    sampler      NA          NA    1        1
// sOceanHeightMask                  texture  float4          2d    0        1
// sOceanHorizontalDisplacementMap    texture  float4          2d    1        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz
// NORMAL                   0   xy          1     NONE   float   xy
// TEXCOORD                 0   xyz         2     NONE   float   xyz
// TEXCOORD                 1   xy          3     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_ClipDistance          1   xyzw        0  CLIPDST   float   xyzw
// SV_ClipDistance          0   xyzw        1  CLIPDST   float   xyzw
// SV_Position              0   xyzw        2      POS   float   xyzw
// TEXCOORD                 0   xyzw        3     NONE   float   xyzw
// TEXCOORD                 1   xyzw        4     NONE   float   xyzw
// TEXCOORD                 2   xyzw        5     NONE   float   xyzw
// TEXCOORD                 3   xyzw        6     NONE   float   xyzw
// TEXCOORD                 4   xyzw        7     NONE   float   xyzw
// TEXCOORD                 5   x           8     NONE   float   x
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[24], immediateIndexed
dcl_constantbuffer cb12[4], immediateIndexed // Disable driver correction
dcl_constantbuffer cb13[4], immediateIndexed // mP2W
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_input v0.xyz
dcl_input v1.xy
dcl_input v2.xyz
dcl_input v3.xy
dcl_output_siv o0.xyzw, clip_distance
dcl_output_siv o1.xyzw, clip_distance
dcl_output_siv o2.xyzw, position
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyzw
dcl_output o8.x
dcl_temps 9

dcl_resource_texture2d (float,float,float,float) t121
ld_indexable(texture2d)(float,float,float,float) r7.xyzw, l(0, 0, 0, 0), t121.xyzw

mov o0.zw, l(0,0,0,0)
add r0.xy, v0.zxzz, v2.yxyy
add r0.zw, r0.yyyx, -cb0[13].zzzw
mul r0.zw, r0.zzzw, cb0[13].xxxy
sample_l_indexable(texture2d)(float,float,float,float) r0.z, r0.zwzz, t0.yzxw, s0, l(0.000000)
add r0.z, -r0.z, cb0[14].x
div_sat r0.z, r0.z, cb0[23].x
add r0.z, -r0.z, l(1.000000)
add r0.z, -r0.z, l(1.000000)
add r0.w, -r0.z, l(1.000000)
mad r0.z, cb0[20].x, r0.w, r0.z
dp2 r0.w, r0.yxyy, cb0[15].xyxx
mul r0.w, r0.w, cb0[18].z
mul r1.x, cb0[16].z, cb0[16].y
mad r0.w, cb0[16].x, r0.w, -r1.x
add r0.w, r0.w, cb0[16].w
sincos r2.x, r3.x, r0.w
mul r0.w, r3.x, cb0[18].x
div r1.yz, cb0[15].yyxy, cb0[16].yyyy
mul r2.yz, r0.wwww, r1.yyzy
mul r2.yz, r2.yyzy, cb0[17].xxxx
div r2.yz, r2.yyzy, cb0[18].zzzz
mul r2.yz, r0.zzzz, r2.yyzy
mad r3.xy, r2.yzyy, cb0[17].xxxx, r0.xyxx
add r2.yz, r3.yyxy, -cb0[13].zzwz
mul r2.yz, r2.yyzy, cb0[13].xxyx
sample_l_indexable(texture2d)(float,float,float,float) r0.w, r2.yzyy, t0.yzwx, s0, l(0.000000)
add r0.w, -r0.w, cb0[14].x
div_sat r1.w, r0.w, cb0[23].x
add r1.w, -r1.w, l(1.000000)
add r1.w, -r1.w, l(1.000000)
mul r2.y, cb0[16].y, cb0[18].y
mul r2.z, r2.y, l(0.159154952)
mul r2.y, r2.y, cb0[16].z
mul r2.y, r2.y, l(0.159154952)
mad r2.yw, -cb0[15].xxxy, r2.yyyy, r3.yyyx
div r2.yw, r2.yyyw, cb0[19].xxxy
sample_l_indexable(texture2d)(float,float,float,float) r2.y, r2.ywyy, t1.yxzw, s1, l(0.000000)
mul r2.y, r2.y, cb0[19].z
mul r2.y, r2.y, l(1000.000000)
mul r2.yw, r2.yyyy, cb0[15].xxxy
mad r4.xz, r2.yywy, r0.zzzz, r3.yyxy
mul r5.xyzw, r2.zzzz, cb0[15].xyxy
mad r5.xyzw, -r5.xyzw, cb0[16].zzzz, r0.yxyx
mul r2.yzw, r5.yyzw, cb0[15].xxxy
mad r2.y, r5.x, cb0[15].y, -r2.y
add r2.z, r2.w, r2.z
mul r2.y, r2.y, l(6.283185)
div r2.y, r2.y, cb0[18].w
mul r2.w, r2.z, cb0[16].x
mul r2.w, r2.w, l(0.500000)
div r3.w, cb0[15].z, cb0[15].w
mad r2.w, -r2.w, r3.w, r2.y
sincos r2.w, null, -r2.w
add r2.w, r2.w, l(1.000000)
mul r2.w, r2.w, l(0.500000)
add r4.w, r2.x, l(1.000000)
mad r2.x, -r4.w, r2.w, r2.x
mul r2.x, r2.x, cb0[18].x
add r5.xy, r0.yxyy, -cb0[0].xzxx
dp2 r4.w, r5.xyxx, cb0[22].xyxx
mad r4.w, -r4.w, cb0[22].z, l(1.000000)
mov_sat r5.x, r4.w
mov o8.x, r4.w
mad r4.w, v0.y, r5.x, cb0[22].w
mad r3.z, r2.x, r5.x, r4.w
add r2.x, r3.z, -cb0[14].x
mad r4.y, r2.x, r1.w, cb0[14].x
mul r6.xyzw, r4.yyyy, cb0[2].xyzw
mov o5.xyz, r4.xyzx
mad r6.xyzw, r4.xxxx, cb0[1].xyzw, r6.xyzw
mad r6.xyzw, r4.zzzz, cb0[3].xyzw, r6.xyzw
add r6.xyzw, r6.xyzw, cb0[4].xyzw

// Apply the standard stereo correction:
add r7.w, r6.w, -r7.y
mad r6.x, r7.w, r7.x, r6.x

// Convert the coorected coordinates back to world space to remove an outline
// of the character (not exacly a halo, but similar):
if_nz cb13[0].x
	mul r8.xyzw, r6.xxxx, cb13[0].xyzw
	mad r8.xyzw, r6.yyyy, cb13[1].xyzw, r8.xyzw
	mad r8.xyzw, r6.zzzz, cb13[2].xyzw, r8.xyzw
	mad r8.xyzw, r6.wwww, cb13[3].xyzw, r8.xyzw
	div o5.xyz, r8.xyzw, r8.wwww
endif

dp4 o0.x, cb0[9].xyzw, r6.xyzw
dp4 o0.y, cb0[10].xyzw, r6.xyzw
dp4 o1.x, cb0[5].xyzw, r6.xyzw
dp4 o1.y, cb0[6].xyzw, r6.xyzw
dp4 o1.z, cb0[7].xyzw, r6.xyzw
dp4 o1.w, cb0[8].xyzw, r6.xyzw

mov o2.xyzw, r6.xyzw

mul o3.zw, r4.xxxz, cb0[12].xxxy
mul o7.xy, r4.xzxx, cb0[11].xyxx
mov o3.xy, v3.xyxx
div r1.w, r2.z, cb0[18].y
ge r2.x, r1.w, -r1.w
frc r1.w, |r1.w|
movc r1.w, r2.x, r1.w, -r1.w
mad r2.x, r1.w, cb0[18].y, cb0[18].y
add r2.x, -r2.x, r2.z
mad r4.x, -r1.w, cb0[18].y, r2.z
mul r4.y, r1.w, cb0[18].y
mad r1.w, -r1.w, cb0[18].y, cb0[18].y
add r1.w, r1.w, r2.z
mul r5.yz, cb0[18].yyyy, l(0.000000, 0.500000, -0.500000, 0.000000)
lt r2.z, r4.y, r5.z
lt r4.y, r5.y, r4.y
movc r2.x, r2.z, r2.x, r4.x
movc r1.w, r4.y, r1.w, r2.x
mul r1.w, r1.w, cb0[16].x
mul r1.w, r3.w, r1.w
mad r1.w, -r1.w, l(0.500000), r2.y
sincos o4.w, null, r1.w
mov o4.xyz, v2.xyzx
mov o5.w, l(1.000000)
mad r2.xy, -cb0[15].yxyy, l(10.000000, 10.000000, 0.000000, 0.000000), r0.xyxx
mad r0.xy, cb0[15].yxyy, l(10.000000, 10.000000, 0.000000, 0.000000), r0.xyxx
mul r4.xy, r2.yxyy, cb0[15].xyxx
add r1.w, r4.y, r4.x
mul r1.w, r1.w, cb0[18].z
mad r1.w, cb0[16].x, r1.w, -r1.x
add r1.w, r1.w, cb0[16].w
sincos r4.x, r6.x, r1.w
mov o6.w, r1.w
add r1.w, r4.x, l(1.000000)
mad r1.w, -r1.w, r2.w, r4.x
mul r2.z, r6.x, cb0[18].x
mul r4.xy, r1.yzyy, r2.zzzz
mul r4.xy, r4.xyxx, cb0[17].xxxx
div r4.xy, r4.xyxx, cb0[18].zzzz
mul r4.xy, r0.zzzz, r4.xyxx
mad r2.xy, r4.xyxx, cb0[17].xxxx, r2.xyxx
mul r1.w, r1.w, cb0[18].x
mad r1.w, r1.w, r5.x, cb0[14].x
add r1.w, -r4.w, r1.w
mad r2.z, r1.w, l(0.500000), r4.w
add r2.xyz, -r3.xyzx, r2.xyzx
dp3 r1.w, r2.xyzx, r2.xyzx
sqrt r1.w, r1.w
lt r1.w, r1.w, l(0.001192)
mul r4.xy, cb0[15].yxyy, l(-10.000000, -10.000000, 0.000000, 0.000000)
mov r4.z, l(0)
movc r2.xyz, r1.wwww, r4.xyzx, r2.xyzx
dp3 r1.w, r2.xyzx, r2.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, r2.xyzx
mul r4.xy, cb0[15].yxyy, l(-1.000000, 1.000000, 0.000000, 0.000000)
dp2 r1.w, r4.xyxx, r4.xyxx
rsq r1.w, r1.w
mul r4.yz, cb0[15].xxyx, l(0.000000, 1.000000, -1.000000, 0.000000)
mov r4.x, l(0)
mul r4.xyz, r1.wwww, r4.xyzx
mul r5.yzw, r2.xxyz, r4.xxyz
mad r2.xyz, r2.zxyz, r4.yzxy, -r5.yzwy
dp3 r1.w, r2.xyzx, r2.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, r2.xyzx
mul r4.xy, r0.yxyy, cb0[15].xyxx
add r1.w, r4.y, r4.x
mul r1.w, r1.w, cb0[18].z
mad r1.x, cb0[16].x, r1.w, -r1.x
add r1.x, r1.x, cb0[16].w
sincos r1.x, r4.x, r1.x
mul r1.w, r4.x, cb0[18].x
mul r1.yz, r1.yyzy, r1.wwww
mul r1.yz, r1.yyzy, cb0[17].xxxx
div r1.yz, r1.yyzy, cb0[18].zzzz
mul r1.yz, r0.zzzz, r1.yyzy
mad r0.xy, r1.yzyy, cb0[17].xxxx, r0.xyxx
add r1.y, r1.x, l(1.000000)
mad r1.x, -r1.y, r2.w, r1.x
mul r1.x, r1.x, cb0[18].x
mad r1.x, r1.x, r5.x, cb0[14].x
mul r1.yz, r5.xxxx, v1.xxyx
add r1.x, -r4.w, r1.x
mad r0.z, r1.x, l(0.500000), r4.w
add r0.xyz, -r3.xyzx, r0.xyzx
dp3 r1.x, r0.xyzx, r0.xyzx
sqrt r1.x, r1.x
lt r1.x, r1.x, l(0.001192)
mul r3.xy, cb0[15].yxyy, l(10.000000, 10.000000, 0.000000, 0.000000)
mov r3.z, l(0)
movc r0.xyz, r1.xxxx, r3.xyzx, r0.xyzx
dp3 r1.x, r0.xyzx, r0.xyzx
rsq r1.x, r1.x
mul r0.xyz, r0.xyzx, r1.xxxx
mul r1.xw, cb0[15].yyyx, l(1.000000, 0.000000, 0.000000, -1.000000)
dp2 r1.x, r1.xwxx, r1.xwxx
rsq r1.x, r1.x
mul r3.yz, cb0[15].xxyx, l(0.000000, -1.000000, 1.000000, 0.000000)
mov r3.x, l(0)
mul r3.xyz, r1.xxxx, r3.xyzx
mul r4.xyz, r0.xyzx, r3.xyzx
mad r0.xyz, r0.zxyz, r3.yzxy, -r4.xyzx
dp3 r1.x, r0.xyzx, r0.xyzx
rsq r1.x, r1.x
mad r0.xyz, r0.xyzx, r1.xxxx, r2.xyzx
dp3 r1.x, r0.xyzx, r0.xyzx
rsq r1.x, r1.x
mul r0.xyz, r0.xyzx, r1.xxxx
lt r1.x, r0.y, l(0.001192)
movc r0.y, r1.x, l(0.001192), r0.y
div r0.xy, r0.xzxx, r0.yyyy
dp2 r0.z, r1.yzyy, r1.yzyy
min r0.z, r0.z, l(1.000000)
add r0.z, -r0.z, l(1.000000)
sqrt r0.z, r0.z
max r0.z, r0.z, l(0.001192)
div r1.xy, r1.yzyy, r0.zzzz
add r0.xz, r0.xxyx, r1.xxyx
mov r0.y, l(1.000000)
dp3 r1.x, r0.xyzx, r0.xyzx
rsq r1.x, r1.x
mul o6.xyz, r0.xyzx, r1.xxxx
div_sat r0.x, r0.w, cb0[21].x
mov o7.w, r0.w
add o7.z, -r0.x, l(1.000000)
ret
// Approximately 207 instruction slots used
