// Smoke
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.2.1 on Sun Aug 30 15:26:39 2015
//
//
// Buffer Definitions: 
//
// cbuffer PER_BATCH
// {
//
//   float3 slHazeColPartialMieInScatter;// Offset:    0 Size:    12 [unused]
//   float4 miscCamFront;               // Offset:   16 Size:    16 [unused]
//   float3 vfColGradDelta;             // Offset:   32 Size:    12
//   float4 vfRampParams;               // Offset:   48 Size:    16
//   float4 PS_NearFarClipDist;         // Offset:   64 Size:    16 [unused]
//   float3 slSunDirection;             // Offset:   80 Size:    12 [unused]
//   float4 CameraFrontVector;          // Offset:   96 Size:    16
//   float3 vfColGradBase;              // Offset:  112 Size:    12
//   float3 slHazeColPartialRayleighInScatter;// Offset:  128 Size:    12 [unused]
//   float3 vfFogColor;                 // Offset:  144 Size:    12 [unused]
//   float3 slPhaseFunctionConstants;   // Offset:  160 Size:    12 [unused]
//   float4 vfParams;                   // Offset:  176 Size:    16
//   float4 vfViewPos;                  // Offset:  192 Size:    16
//
// }
//
// cbuffer PER_INSTANCE
// {
//
//   float4 TexTileSize;                // Offset:    0 Size:    16
//   float4 ParticleParams;             // Offset:   16 Size:    16
//
// }
//
// cbuffer PER_FRAME
// {
//
//   row_major float4x4 g_VS_ViewProjMatr;// Offset:    0 Size:    64
//   float4 g_VS_WorldViewPos;          // Offset:   80 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PER_BATCH                         cbuffer      NA          NA    0        1
// PER_INSTANCE                      cbuffer      NA          NA    1        1
// PER_FRAME                         cbuffer      NA          NA    3        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyz 
// COLOR                    0   xyzw        1     NONE   float   xyzw
// COLOR                    1   xyzw        2     NONE   float     zw
// PSIZE                    0   xyzw        3     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
// TEXCOORD                 3   x           4     NONE   float   x   
// COLOR                    1    y          4     NONE   float    y  
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// TEXCOORD                 5   xyzw        6     NONE   float   xyzw
// COLOR                    0   xyzw        7     NONE   float   xyzw
//
gs_5_0
dcl_globalFlags refactoringAllowed
dcl_immediateConstantBuffer { { 0.294000, 0, 0, 0},
                              { 0.706000, 0, 0, 0},
                              { 0, 0.294000, 0, 0},
                              { 1.000000, 0.294000, 0, 0},
                              { 0, 0.706000, 0, 0},
                              { 1.000000, 0.706000, 0, 0},
                              { 0.294000, 1.000000, 0, 0},
                              { 0.706000, 1.000000, 0, 0} }
dcl_constantbuffer cb0[13], immediateIndexed
dcl_constantbuffer cb1[2], immediateIndexed
dcl_constantbuffer cb3[4], immediateIndexed
dcl_input_siv v[1][0].xyzw, position
dcl_input v[1][1].xyzw
dcl_input v[1][2].xyzw
dcl_input v[1][3].xyzw
//dcl_temps 8
dcl_temps 9

dcl_inputprimitive point 
dcl_stream m0
dcl_outputtopology trianglestrip 
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.x
dcl_output o4.y
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyzw
dcl_maxout 8

dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r8.xyzw, l(0, 0, 0, 0), t125.xyzw


add r0.x, |v[0][3].y|, |v[0][3].x|
lt r0.x, l(0.000000), r0.x
itof r0.x, -r0.x
add r0.yzw, cb0[12].zzxy, -v[0][0].zzxy
dp3 r1.x, r0.yzwy, r0.yzwy
rsq r1.x, r1.x
mul r0.yzw, r0.yyzw, r1.xxxx
mad r1.xyz, -cb0[6].zxyz, cb0[6].zzzz, l(1.000000, 0.000000, 0.000000, 0.000000)
mul r2.xyz, r0.wyzw, r1.xyzx
mad r1.xyz, r1.zxyz, r0.yzwy, -r2.xyzx
dp3 r1.w, r1.xyzx, r1.xyzx
rsq r1.w, r1.w
mul r1.xyz, r1.wwww, r1.xyzx
mul r2.xyz, r0.yzwy, r1.yzxy
mad r0.yzw, r0.wwyz, r1.zzxy, -r2.xxyz
ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), r0.x
mul r1.w, cb1[1].x, v[0][1].w
mov r2.w, l(1.000000)
mov r3.x, v[0][2].z
mov r3.y, l(0)
loop 
  ige r3.z, r3.y, l(8)
  breakc_nz r3.z
  mad r4.xyzw, icb[r3.y + 0].xxyy, l(2.000000, 2.000000, -2.000000, -2.000000), l(-1.000000, -1.000000, 1.000000, 1.000000)
  mul r4.xyzw, r4.xyzw, v[0][3].xyzw
  mul r5.xyz, r0.yzwy, r4.yyyy
  mad r5.xyz, r1.xyzx, r4.xxxx, r5.xyzx
  mul r6.xyz, r0.yzwy, r4.wwww
  mad r6.xyz, r1.xyzx, r4.zzzz, r6.xyzx
  add r5.xyz, r5.xyzx, r6.xyzx
  add r5.xyz, r5.xyzx, v[0][0].xyzx
  movc r2.xyz, r0.xxxx, r5.xyzx, v[0][0].xyzx
  dp4 r5.x, cb3[0].xyzw, r2.xyzw
  dp4 r5.y, cb3[1].xyzw, r2.xyzw
  dp4 r3.z, cb3[2].xyzw, r2.xyzw
  dp4 r3.w, cb3[3].xyzw, r2.xyzw
  mul r4.y, r4.z, r4.y
  mad r4.x, r4.x, r4.w, -r4.y
  sqrt r4.x, |r4.x|
  div r4.x, l(3.000000), r4.x
  mad r4.yz, r5.xxyx, l(0.000000, 1.000000, -1.000000, 0.000000), r3.wwww
  
   // Halo fix
  add r8.w, r3.w, -r8.y
  mad r4.y, r8.w, r8.x, r4.y
  
  mul r4.yz, r4.yyzy, l(0.000000, 0.500000, 0.500000, 0.000000)
  mov r5.zw, icb[r3.y + 0].xxxy
  mul r4.w, r5.w, cb1[0].y
  mad r5.w, r3.x, cb1[0].z, cb1[0].w
  round_ni r5.w, r5.w
  mul r5.w, r5.w, cb1[0].x
  frc r6.x, r5.w
  mad r5.z, r5.z, cb1[0].x, r6.x
  round_ni r5.w, r5.w
  mad r4.w, r5.w, cb1[0].y, r4.w
  add r6.xyz, -r2.xyzx, cb0[12].xyzx
  add r7.xyz, r2.xyzx, -v[0][0].xyzx
  dp3 r5.w, r6.xyzx, r7.xyzx
  dp3 r6.w, r6.xyzx, r6.xyzx
  div r5.w, r5.w, r6.w
  mad r7.xyz, -r6.xyzx, r5.wwww, r7.xyzx
  movc r6.xyz, r0.xxxx, r7.xyzx, r6.xyzx
  dp3 r5.w, r6.xyzx, r6.xyzx
  rsq r5.w, r5.w
  mul r6.xyz, r5.wwww, r6.xyzx
  add r7.xyz, r2.xyzx, -cb0[12].xyzx
  lt r5.w, l(0.010000), |r7.z|
  mul r6.w, r7.z, cb0[11].x
  mul r7.w, r6.w, l(-1.442695)
  exp r7.w, r7.w
  add r7.w, -r7.w, l(1.000000)
  div r6.w, r7.w, r6.w
  movc r5.w, r5.w, r6.w, l(1.000000)
  dp3 r6.w, r7.xyzx, r7.xyzx
  sqrt r7.x, r6.w
  mul r7.y, r7.x, cb0[11].y
  mad r5.w, r5.w, r7.y, -cb0[11].w
  exp r5.w, -r5.w
  min r5.w, r5.w, l(1.000000)
  mad_sat r7.x, r7.x, cb0[3].x, cb0[3].y
  add r7.y, -r7.x, l(2.000000)
  mul r7.x, r7.y, r7.x
  mad r7.x, r7.x, cb0[3].z, cb0[3].w
  add r5.w, -r5.w, l(1.000000)
  mad r5.w, -r5.w, r7.x, l(1.000000)
  rsq r6.w, r6.w
  mul_sat r6.w, r6.w, r7.z
  mad r7.xyz, r6.wwww, cb0[2].xyzx, cb0[7].xyzx
  mov o0.xy, r5.xyxx
  mov o0.z, r3.z
  mov o0.w, r3.w
  mov o1.x, r5.z
  mov o1.y, r4.w
  mov o1.z, cb1[1].y
  mov o1.w, l(0)
  mov o2.xyz, r2.xyzx
  mov o2.w, l(0)
  mov o3.xy, r4.yzyy
  mov o3.z, r3.z
  mov o3.w, r3.w
  mov o4.x, r4.x
  mov o4.y, v[0][2].w
  mov o5.xyz, r7.xyzx
  mov o5.w, r5.w
  mov o6.xyz, r6.xyzx
  mov o6.w, l(0)
  mov o7.xyz, v[0][1].zyxz
  mov o7.w, r1.w
  emit_stream m0
  iadd r3.y, r3.y, l(1)
endloop 
cut_stream m0
ret 
// Approximately 109 instruction slots used
