// HUD - mouse click sparkle + Pool sparkle
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.4 on Mon Mar 05 05:00:39 2018
//
//
// Buffer Definitions:
//
// cbuffer vector_register_block
// {
//
//   float3 gEffectHemisphereVector;    // Offset:    0 Size:    12 [unused]
//   float3 gEffectHemisphereColor0;    // Offset:   16 Size:    12 [unused]
//   float3 gEffectHemisphereColor1;    // Offset:   32 Size:    12 [unused]
//   row_major float3x3 gEffectLightDirection;// Offset:   48 Size:    44 [unused]
//   row_major float3x3 gEffectLightColorDir;// Offset:   96 Size:    44 [unused]
//   float4 gEffectLightPosition[4];    // Offset:  144 Size:    64 [unused]
//   float4 gEffectLightColorPoint[4];  // Offset:  208 Size:    64 [unused]
//   float3 gEffectIblDiffuseColor;     // Offset:  304 Size:    12 [unused]
//   row_major float4x4 gEffectWorldViewProj;// Offset:  480 Size:    64
//   row_major float4x4 gEffectShadingMatrix;// Offset:  544 Size:    64
//   float3 gEffectEyePosition;         // Offset:  608 Size:    12
//   float4 gEffectUVOffset;            // Offset:  624 Size:    16
//   float4 gEffectConstantColor;       // Offset:  640 Size:    16
//   float4 gEffectDistanceFade_VThickness;// Offset:  656 Size:    16
//
// }
//
// cbuffer bool_register_block
// {
//
//   bool gEnableMultiUV;               // Offset:    0 Size:     4
//   bool gEnableVertexColor;           // Offset:    4 Size:     4
//   bool gEnableLighting;              // Offset:    8 Size:     4 [unused]
//   bool gEnablePointLight0;           // Offset:   12 Size:     4 [unused]
//   bool gEnablePointLight1;           // Offset:   16 Size:     4 [unused]
//   bool gEnablePointLight2;           // Offset:   20 Size:     4 [unused]
//   bool gEnablePointLight3;           // Offset:   24 Size:     4 [unused]
//   bool gFogEnable;                   // Offset:   28 Size:     4
//   bool gEnableLightScatter;          // Offset:   32 Size:     4
//   bool gBlendUnDestOne;              // Offset:   36 Size:     4
//   bool gEnableSoftParticle;          // Offset:   40 Size:     4 [unused]
//   int bool_register_block_padding;   // Offset:   44 Size:     4 [unused]
//
// }
//
// cbuffer model_low_frequency_block
// {
//
//   row_major float4x4 gViewProjection;// Offset:    0 Size:    64 [unused]
//   float4 gEyePosition;               // Offset:   64 Size:    16 [unused]
//   row_major float4x4 gViewMatrix;    // Offset:   80 Size:    64 [unused]
//   row_major float4x4 gShadowMatrix;  // Offset:  144 Size:    64 [unused]
//   float4 gClipPlane0;                // Offset:  208 Size:    16 [unused]
//   float4 gLScatterSunColor;          // Offset:  224 Size:    16
//   float4 gLScatterSunDir;            // Offset:  240 Size:    16
//   float4 gLScatterOutTmp;            // Offset:  256 Size:    16
//   float4 gLScatterRayTmp;            // Offset:  272 Size:    16
//   float4 gLScatterMieTmp;            // Offset:  288 Size:    16
//   float4 gFogMiddle;                 // Offset:  304 Size:    16
//   float4 gFogFarMiddle;              // Offset:  320 Size:    16
//   float4 gFogDistance;               // Offset:  336 Size:    16
//   float4 gFogDensity;                // Offset:  352 Size:    16
//   float4 gHeightFogMiddle;           // Offset:  368 Size:    16
//   float4 gHeightFogFarMiddle;        // Offset:  384 Size:    16
//   float4 gHeightFogDistance;         // Offset:  400 Size:    16
//   float4 gHeightFogDensity;          // Offset:  416 Size:    16
//   row_major float4x4 gSecondShadowMatrix;// Offset:  432 Size:    64 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// vector_register_block             cbuffer      NA          NA    0        1
// bool_register_block               cbuffer      NA          NA    1        1
// model_low_frequency_block         cbuffer      NA          NA    9        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xyzw        2     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[42], immediateIndexed
dcl_constantbuffer cb1[3], immediateIndexed
dcl_constantbuffer cb9[27], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyzw
dcl_input v2.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_temps 6
dcl_resource_texture2d (float,float,float,float) t125
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture2d)(float,float,float,float) r4.xyzw, l(0, 0, 0, 0), t125.xyzw
ld_indexable(texture1d)(float,float,float,float) r5.xyzw, l(0, 0, 0, 0), t120.xyzw

mul r0.xyzw, v0.yyyy, cb0[31].xyzw
mad r0.xyzw, v0.xxxx, cb0[30].xyzw, r0.xyzw
mad r0.xyzw, v0.zzzz, cb0[32].xyzw, r0.xyzw
add r0.xyzw, r0.xyzw, cb0[33].xyzw

// Return HUD to screen depth, but use a cutoff depth to prevent breaking the
// pool sparkle.

//if (o0.w < hud_depth_cutoff)
lt r4.w, r0.w, r5.x
if_nz r4.w
	// o0.x -= s.x * (o0.w - s.y);
	add r4.w, r0.w, -r4.y
	mad r0.x, -r4.w, r4.x, r0.x
endif

mov o0.xyzw, r0.xyzw
mov r1.xyz, cb0[40].xyzx
mov r1.w, l(1.000000)
mul r2.xyzw, r1.xyzw, v1.xyzw
movc r1.xyzw, cb1[0].yyyy, r2.xyzw, r1.xyzw
mul o1.w, r1.w, cb0[40].w
mov o1.xyz, r1.xyzx
add r1.xyzw, v2.xyzw, cb0[39].xyzw
movc o2.xyzw, cb1[0].xxxx, r1.xyzw, r1.xyxy
add r0.xyz, v0.xyzx, -cb0[38].xyzx
dp3 r1.x, r0.xyzx, r0.xyzx
sqrt r1.x, r1.x
div r0.xyz, r0.xyzx, r1.xxxx
mul r1.xyz, r1.xxxx, cb9[16].xyzx
exp r1.xyz, r1.xyzx
add r1.xyz, -r1.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r2.xyz, r0.yyyy, cb0[35].xyzx
mad r2.xyz, r0.xxxx, cb0[34].xyzx, r2.xyzx
mad r0.xyz, r0.zzzz, cb0[36].xyzx, r2.xyzx
dp3 r1.w, r0.xyzx, r0.xyzx
rsq r1.w, r1.w
mul r0.xyz, r0.xyzx, r1.wwww
dp3 r0.x, cb9[15].xyzx, r0.xyzx
mad r0.y, cb9[18].w, r0.x, cb9[17].w
mad r0.x, r0.x, r0.x, l(1.000000)
mul r0.z, r0.y, r0.y
mul r0.y, r0.y, r0.z
sqrt r0.y, r0.y
div r2.xyz, cb9[18].xyzx, r0.yyyy
mad r0.xyz, cb9[17].xyzx, r0.xxxx, r2.xyzx
mul r0.xyz, r1.xyzx, r0.xyzx
mul r0.xyz, r0.xyzx, cb9[14].xyzx
movc r0.xyz, cb1[2].yyyy, r0.xyzx, l(0,0,0,0)
movc r0.xyz, cb1[2].xxxx, r0.xyzx, l(0,0,0,0)
add r1.xy, v0.yyyy, -cb9[25].xyxx
mul_sat r1.xy, r1.xyxx, cb9[25].zwzz
mad r2.xyz, cb9[24].xyzx, r1.yyyy, cb9[23].xyzx
movc r1.zw, cb1[1].wwww, cb9[26].xxxy, l(0,0,0,0)
dp2 r1.x, r1.xyxx, r1.zwzz
mul r1.yzw, r1.xxxx, r2.xxyz
add r1.x, -r1.x, l(1.000000)
mad r1.xyz, r0.xyzx, r1.xxxx, r1.yzwy
add r2.xy, r0.wwww, -cb9[21].xyxx
mad o3.w, cb0[41].x, r0.w, cb0[41].y
mul_sat r2.xy, r2.xyxx, cb9[21].zwzz
mad r3.xyz, cb9[20].xyzx, r2.yyyy, cb9[19].xyzx
movc r2.zw, cb1[1].wwww, cb9[22].xxxy, l(0,0,0,0)
dp2 r0.w, r2.xyxx, r2.zwzz
mul r2.xyz, r0.wwww, r3.xyzx
add r0.w, -r0.w, l(1.000000)
mad r1.xyz, r1.xyzx, r0.wwww, r2.xyzx
movc o3.xyz, cb1[2].yyyy, r1.xyzx, r0.xyzx
ret
// Approximately 57 instruction slots used