//sky
// ---- Created with 3Dmigoto v1.2.67 on Fri Dec 01 20:25:56 2017
Texture3D<float4> t7 : register(t7);

Texture3D<float4> t6 : register(t6);

Texture3D<float4> t5 : register(t5);

Texture3D<float4> t4 : register(t4);

Texture2D<float4> t2 : register(t2);

Texture3D<float4> t1 : register(t1);

Texture3D<float4> t0 : register(t0);

SamplerState s7_s : register(s7);

SamplerState s6_s : register(s6);

SamplerState s5_s : register(s5);

SamplerState s4_s : register(s4);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb5 : register(b5)
{
  float4 cb5[2];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[26];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
  float4 v0 : SV_POSITION0,
  float2 v1 : TEXCOORD0,
  float2 w1 : TEXCOORD1,
  float4 v2 : TEXCOORD8,
  float4 v3 : TEXCOORD2,
  float4 v4 : TEXCOORD3,
  float4 v5 : TEXCOORD4,
  float4 v6 : TEXCOORD5,
  float3 v7 : TEXCOORD6,
  float v8 : SV_CullDistance0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = float2(8,8) * v1.xy;
  r0.xyz = t2.Sample(s2_s, r0.xy).xyz;
  r0.xyz = float3(-0.498039216,-0.498039216,-0.498039216) + r0.zyx;
  r1.xyz = t2.Sample(s2_s, v1.xy).xyz;
  r1.xyz = float3(-0.498039216,-0.498039216,-0.498039216) + r1.zyx;
  r0.xyz = r0.xyz * float3(0.5,0.5,0.5) + r1.xyz;
  r0.xyz = v3.www * r0.xyz;
  r0.xyz = cb0[20].xyz * r0.xyz + v3.xyz;
  r1.xyzw = t1.SampleLevel(s1_s, r0.xyz, 0).xyzw;
  r0.xyzw = t0.SampleLevel(s0_s, r0.xyz, 0).xyzw;
  r1.xyzw = r1.zyxw + -r0.zyxw;
  r0.xyzw = cb0[18].yyyy * r1.xyzw + r0.zyxw;
  r0.x = w1.x * r0.x;
  r1.x = cb0[18].w + 1;
  r0.x = saturate(r0.x * r1.x + -cb0[18].w);
  r1.x = -9.99999975e-005 + r0.x;
  r1.x = cmp(r1.x < 0);
  if (r1.x != 0) discard;
  r1.x = cb0[18].z * r0.z;
  r1.y = r1.x * r1.x + 1;
  r1.z = dot(v4.xyz, v4.xyz);
  r1.z = rsqrt(r1.z);
  r2.xyz = v4.xyz * r1.zzz;
  r1.z = dot(cb0[25].xyz, r2.xyz);
  r1.w = dot(r1.zz, r1.xx);
  r1.x = -r1.x * r1.x + 1;
  r1.y = r1.y + -r1.w;
  r1.y = log2(r1.y);
  r1.xy = float2(0.5,1.5) * r1.xy;
  r1.y = exp2(r1.y);
  r1.y = 12.566371 * r1.y;
  r1.x = r1.x / r1.y;
  r1.x = 0.0397884995 + r1.x;
  r1.x = cb0[21].x * r1.x;
  r0.y = cb0[21].y * r0.y;
  r0.y = r0.z * r1.x + r0.y;
  r1.xyw = cb0[24].xyz * r0.www;
  r0.yzw = r0.yyy * v6.xyz + r1.xyw;
  r1.x = dot(r1.zz, cb0[18].xx);
  r1.y = r1.z * r1.z + 1;
  r1.z = cb0[18].x * cb0[18].x + 1;
  r1.x = r1.z + -r1.x;
  r1.x = log2(r1.x);
  r1.x = 1.5 * r1.x;
  r1.x = exp2(r1.x);
  r1.z = -cb0[18].x * cb0[18].x + 1;
  r1.xz = float2(12.566371,0.5) * r1.xz;
  r1.x = r1.z / r1.x;
  r1.x = 0.0397884995 + r1.x;
  r2.xyzw = t7.SampleLevel(s7_s, v7.xyz, 0).xyzw;
  r3.xyzw = t6.SampleLevel(s6_s, v7.xyz, 0).xyzw;
  r2.xyzw = -r3.xyzw + r2.xyzw;
  r2.xyzw = cb0[25].wwww * r2.xyzw + r3.xyzw;
  r1.x = r2.w * r1.x;
  r1.xzw = cb0[19].xyz * r1.xxx;
  r1.xyz = r1.yyy * float3(0.0596830994,0.0596830994,0.0596830994) + r1.xzw;
  r3.xyz = r2.www * cb0[19].xyz + float3(1,1,1);
  r1.xyz = r1.xyz / r3.xyz;
  r1.xyz = r1.xyz * r2.xyz;
  r2.xyz = t5.SampleLevel(s5_s, v7.xyz, 0).xyz;
  r3.xyz = t4.SampleLevel(s4_s, v7.xyz, 0).xyz;
  r2.xyz = -r3.xyz + r2.xyz;
  r2.xyz = cb0[25].www * r2.xyz + r3.xyz;
  r0.yzw = r0.yzw * r2.xyz + r1.xyz;
  r0.yzw = cb5[1].xyz * r0.yzw;
  r1.xyz = cb0[7].xyz * v2.yyy;
  r1.xyz = cb0[1].xyz * v2.xxx + r1.xyz;
  r0.yzw = r0.yzw * v2.zzz + r1.xyz;
  o0.xyz = r0.yzw * r0.xxx;
  o0.w = r0.x;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.67 on Fri Dec 01 20:25:56 2017
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float       
// TEXCOORD                 0   xy          1     NONE   float   xy  
// TEXCOORD                 1     zw        1     NONE   float     z 
// TEXCOORD                 8   xyz         2     NONE   float   xyz 
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 3   xyz         4     NONE   float   xyz 
// TEXCOORD                 4   xyz         5     NONE   float       
// TEXCOORD                 5   xyz         6     NONE   float   xyz 
// TEXCOORD                 6   xyz         7     NONE   float   xyz 
// SV_CullDistance          0   x           8  CULLDST   float       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[26], immediateIndexed
dcl_constantbuffer cb5[2], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_sampler s7, mode_default
dcl_resource_texture3d (float,float,float,float) t0
dcl_resource_texture3d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture3d (float,float,float,float) t4
dcl_resource_texture3d (float,float,float,float) t5
dcl_resource_texture3d (float,float,float,float) t6
dcl_resource_texture3d (float,float,float,float) t7
dcl_input_ps linear v1.xy
dcl_input_ps linear v1.z
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xyzw
dcl_input_ps linear v4.xyz
dcl_input_ps linear v6.xyz
dcl_input_ps linear v7.xyz
dcl_output o0.xyzw
dcl_temps 4
mul r0.xy, v1.xyxx, l(8.000000, 8.000000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t2.xyzw, s2
add r0.xyz, r0.zyxz, l(-0.498039216, -0.498039216, -0.498039216, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r1.xyz, v1.xyxx, t2.xyzw, s2
add r1.xyz, r1.zyxz, l(-0.498039216, -0.498039216, -0.498039216, 0.000000)
mad r0.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r1.xyzx
mul r0.xyz, r0.xyzx, v3.wwww
mad r0.xyz, cb0[20].xyzx, r0.xyzx, v3.xyzx
sample_l_indexable(texture3d)(float,float,float,float) r1.xyzw, r0.xyzx, t1.xyzw, s1, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r0.xyzw, r0.xyzx, t0.xyzw, s0, l(0.000000)
add r1.xyzw, -r0.zyxw, r1.zyxw
mad r0.xyzw, cb0[18].yyyy, r1.xyzw, r0.zyxw
mul r0.x, r0.x, v1.z
add r1.x, l(1.000000), cb0[18].w
mad_sat r0.x, r0.x, r1.x, -cb0[18].w
add r1.x, r0.x, l(-0.000100)
lt r1.x, r1.x, l(0.000000)
discard_nz r1.x
mul r1.x, r0.z, cb0[18].z
mad r1.y, r1.x, r1.x, l(1.000000)
dp3 r1.z, v4.xyzx, v4.xyzx
rsq r1.z, r1.z
mul r2.xyz, r1.zzzz, v4.xyzx
dp3 r1.z, cb0[25].xyzx, r2.xyzx
dp2 r1.w, r1.zzzz, r1.xxxx
mad r1.x, -r1.x, r1.x, l(1.000000)
add r1.y, -r1.w, r1.y
log r1.y, r1.y
mul r1.xy, r1.xyxx, l(0.500000, 1.500000, 0.000000, 0.000000)
exp r1.y, r1.y
mul r1.y, r1.y, l(12.566371)
div r1.x, r1.x, r1.y
add r1.x, r1.x, l(0.0397884995)
mul r1.x, r1.x, cb0[21].x
mul r0.y, r0.y, cb0[21].y
mad r0.y, r0.z, r1.x, r0.y
mul r1.xyw, r0.wwww, cb0[24].xyxz
mad r0.yzw, r0.yyyy, v6.xxyz, r1.xxyw
dp2 r1.x, r1.zzzz, cb0[18].xxxx
mad r1.y, r1.z, r1.z, l(1.000000)
mad r1.z, cb0[18].x, cb0[18].x, l(1.000000)
add r1.x, -r1.x, r1.z
log r1.x, r1.x
mul r1.x, r1.x, l(1.500000)
exp r1.x, r1.x
mad r1.z, -cb0[18].x, cb0[18].x, l(1.000000)
mul r1.xz, r1.xxzx, l(12.566371, 0.000000, 0.500000, 0.000000)
div r1.x, r1.z, r1.x
add r1.x, r1.x, l(0.0397884995)
sample_l_indexable(texture3d)(float,float,float,float) r2.xyzw, v7.xyzx, t7.xyzw, s7, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r3.xyzw, v7.xyzx, t6.xyzw, s6, l(0.000000)
add r2.xyzw, r2.xyzw, -r3.xyzw
mad r2.xyzw, cb0[25].wwww, r2.xyzw, r3.xyzw
mul r1.x, r1.x, r2.w
mul r1.xzw, r1.xxxx, cb0[19].xxyz
mad r1.xyz, r1.yyyy, l(0.0596830994, 0.0596830994, 0.0596830994, 0.000000), r1.xzwx
mad r3.xyz, r2.wwww, cb0[19].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
div r1.xyz, r1.xyzx, r3.xyzx
mul r1.xyz, r2.xyzx, r1.xyzx
sample_l_indexable(texture3d)(float,float,float,float) r2.xyz, v7.xyzx, t5.xyzw, s5, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r3.xyz, v7.xyzx, t4.xyzw, s4, l(0.000000)
add r2.xyz, r2.xyzx, -r3.xyzx
mad r2.xyz, cb0[25].wwww, r2.xyzx, r3.xyzx
mad r0.yzw, r0.yyzw, r2.xxyz, r1.xxyz
mul r0.yzw, r0.yyzw, cb5[1].xxyz
mul r1.xyz, v2.yyyy, cb0[7].xyzx
mad r1.xyz, cb0[1].xyzx, v2.xxxx, r1.xyzx
mad r0.yzw, r0.yyzw, v2.zzzz, r1.xxyz
mul o0.xyz, r0.xxxx, r0.yzwy
mov o0.w, r0.x
ret 
// Approximately 0 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
