//not sure
// ---- Created with 3Dmigoto v1.2.39 on Sun Jun 26 04:15:09 2016

cbuffer _Globals : register(b0)
{
  float4x4 LocalToWorld : packoffset(c0);
  float4x4 ScreenToWorldMatrix : packoffset(c4);
  bool bDecompressSceneColor : packoffset(c8);
  float4 PackedParameters : packoffset(c9);
  float4 MinMaxBlurClamp : packoffset(c10);
  float4 LightColorAndFalloffExponent : packoffset(c11);
  float3 DistanceFieldParameters : packoffset(c12);
  float4x4 ScreenToShadowMatrix : packoffset(c13);
  float4 ShadowBufferAndTexelSize : packoffset(c17);
  float ShadowOverrideFactor : packoffset(c18);
  float SSSMultiplier : packoffset(c18.y);
  bool bReceiveDynamicShadows : packoffset(c18.z);
  bool bEnableDistanceShadowFading : packoffset(c18.w);
  float2 DistanceFadeParameters : packoffset(c19);
  float4 IBLPositionAndWeight0 : packoffset(c20);
  float4 IBLPositionAndWeight1 : packoffset(c21);
  float4 IBLPositionAndWeight2 : packoffset(c22);
  float4 IBLPositionAndWeight3 : packoffset(c23);
  float4x4 IBLProxyOBB0 : packoffset(c24);
  float4x4 IBLProxyOBB1 : packoffset(c28);
  float4x4 IBLProxyOBB2 : packoffset(c32);
  float4 IBLUseProxyVolume : packoffset(c36);
  float4x4 IBLLastProxyOBB0 : packoffset(c37);
  float4x4 IBLLastProxyOBB1 : packoffset(c41);
  float4x4 IBLLastProxyOBB2 : packoffset(c45);
  float4 IBLUseLastProxyVolume : packoffset(c49);
  float ForcedIBLWeight : packoffset(c50);
  float AdditionalReflections : packoffset(c50.y);
  float4x4 InvViewProjectionMatrix : packoffset(c51);
  float3 CameraWorldPos : packoffset(c55);
  float3 ActorWorldPos : packoffset(c56);
  float4 ObjectWorldPositionAndRadius : packoffset(c57);
  float3 ObjectOrientation : packoffset(c58);
  float3 ObjectPostProjectionPosition : packoffset(c59);
  float3 ObjectNDCPosition : packoffset(c60);
  float4 ObjectMacroUVScales : packoffset(c61);
  float3 FoliageImpulseDirection : packoffset(c62);
  float4 FoliageNormalizedRotationAxisAndAngle : packoffset(c63);
  float4 WindDirectionAndSpeed : packoffset(c64);
  float3x3 LocalToWorldMatrix : packoffset(c65);
  float3x3 WorldToLocalMatrix : packoffset(c68);
  float3x3 WorldToViewMatrix : packoffset(c71);
  float3x3 ViewToWorldMatrix : packoffset(c74);
  float4 UniformPixelVector_0 : packoffset(c77);
  float4 UniformPixelVector_1 : packoffset(c78);
  float4 UniformPixelVector_2 : packoffset(c79);
  float4 UniformPixelVector_3 : packoffset(c80);
  float4 UniformPixelVector_4 : packoffset(c81);
  float4 UniformPixelVector_5 : packoffset(c82);
  float4 UniformPixelVector_6 : packoffset(c83);
  float4 UniformPixelVector_7 : packoffset(c84);
  float4 UniformPixelVector_8 : packoffset(c85);
  float4 UniformPixelVector_9 : packoffset(c86);
  float4 UniformPixelVector_10 : packoffset(c87);
  float4 UniformPixelVector_11 : packoffset(c88);
  float4 UniformPixelVector_12 : packoffset(c89);
  float4 UniformPixelVector_13 : packoffset(c90);
  float4 UniformPixelVector_14 : packoffset(c91);
  float4 UniformPixelScalars_0 : packoffset(c92);
  float4 UniformPixelScalars_1 : packoffset(c93);
  float4 UniformPixelScalars_2 : packoffset(c94);
  float4 UniformPixelScalars_3 : packoffset(c95);
  float4 UniformPixelScalars_4 : packoffset(c96);
  float4 UniformPixelScalars_5 : packoffset(c97);
  float3 TemporalAAParameters : packoffset(c98);
  float4x4 PreviousLocalToWorld : packoffset(c99);
  float LocalToWorldRotDeterminantFlip : packoffset(c103);
  float3x3 WorldToLocal : packoffset(c104);
  float4 LightmapCoordinateScaleBias : packoffset(c107);
  float4 ShadowmapCoordinateScaleBias : packoffset(c108);
  float SubSurfaceQuality : packoffset(c109);
  float3 SpotDirection : packoffset(c109.y);
  float2 SpotAngles : packoffset(c110);
  float4 LightPositionAndInvRadius : packoffset(c111);
}

cbuffer VSOffsetConstants : register(b1)
{
  float4x4 ViewProjectionMatrix : packoffset(c0);
  float4 CameraPositionVS : packoffset(c4);
  float4 PreViewTranslation : packoffset(c5);
}

cbuffer PSOffsetConstants : register(b2)
{
  float4 ScreenPositionScaleBias : packoffset(c0);
  float4 MinZ_MaxZRatio : packoffset(c1);
  float NvStereoEnabled : packoffset(c2);
  float4 DiffuseOverrideParameter : packoffset(c3);
  float4 SpecularOverrideParameter : packoffset(c4);
  float4 CameraPositionPS : packoffset(c5);
  float4 ScreenAndTexelSize : packoffset(c6);
}

SamplerState NvStereoFixTextureSampler_s : register(s0);
SamplerState LightAttenuationTextureSampler_s : register(s1);
SamplerState ShadowTextureSampler_s : register(s2);
SamplerState PixelTexture2D_0Sampler_s : register(s3);
SamplerState PixelTexture2D_1Sampler_s : register(s4);
SamplerState PixelTexture2D_2Sampler_s : register(s5);
SamplerState PixelTexture2D_3Sampler_s : register(s6);
SamplerState PixelTexture2D_4Sampler_s : register(s7);
SamplerState PixelTexture2D_5Sampler_s : register(s8);
SamplerState PixelTexture2D_6Sampler_s : register(s9);
SamplerState PixelTexture2D_7Sampler_s : register(s10);
SamplerState PixelTexture2D_8Sampler_s : register(s11);
SamplerState PixelTexture2D_9Sampler_s : register(s12);
Texture2D<float4> NvStereoFixTexture : register(t0);
Texture2D<float4> LightAttenuationTexture : register(t1);
Texture2D<float4> ShadowTexture : register(t2);
Texture2D<float4> PixelTexture2D_0 : register(t3);
Texture2D<float4> PixelTexture2D_1 : register(t4);
Texture2D<float4> PixelTexture2D_2 : register(t5);
Texture2D<float4> PixelTexture2D_3 : register(t6);
Texture2D<float4> PixelTexture2D_4 : register(t7);
Texture2D<float4> PixelTexture2D_5 : register(t8);
Texture2D<float4> PixelTexture2D_6 : register(t9);
Texture2D<float4> PixelTexture2D_7 : register(t10);
Texture2D<float4> PixelTexture2D_8 : register(t11);
Texture2D<float4> PixelTexture2D_9 : register(t12);


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


void main( 
  float4 v0 : TEXCOORD10,
  float4 v1 : TEXCOORD11,
  float4 v2 : COLOR0,
  float4 v3 : TEXCOORD0,
  float4 v4 : TEXCOORD1,
  float4 v5 : TEXCOORD4,
  float4 v6 : TEXCOORD5,
  float4 v7 : TEXCOORD6,
  float4 v8 : TEXCOORD7,
  uint v9 : SV_IsFrontFace0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = dot(v7.xyz, v7.xyz);
  r0.x = rsqrt(r0.x);
  r0.yzw = v7.xyz * r0.xxx;
  r1.x = dot(v5.xyz, v5.xyz);
  r1.x = rsqrt(r1.x);
  r1.xyz = v5.xyz * r1.xxx;
  r2.xyz = PixelTexture2D_0.SampleBias(PixelTexture2D_0Sampler_s, v4.xy, 0).xyz;
  r2.xyz = r2.xyz * float3(2,2,2) + float3(-1,-1,-1);
  r3.xyz = PixelTexture2D_1.SampleBias(PixelTexture2D_1Sampler_s, v4.xy, 0).xyz;
  r3.xyz = r3.xyz * float3(2,2,2) + float3(-1,-1,-1);
  r3.xyz = UniformPixelVector_4.xyz * r3.xyz;
  r4.xyz = PixelTexture2D_2.SampleBias(PixelTexture2D_2Sampler_s, v4.xy, 0).xyz;
  r4.xyz = r4.xyz * float3(2,2,2) + float3(-1,-1,-1);
  r5.xy = PixelTexture2D_3.SampleBias(PixelTexture2D_3Sampler_s, v4.xy, 0).xy;
  r5.zw = float2(-0.5,-0.5) + v2.xy;
  r5.xy = r5.zw * float2(2,2) + r5.xy;
  r1.w = saturate(UniformPixelScalars_0.w * r5.x);
  r2.w = cmp(r1.w < 9.99999997e-007);
  r1.w = log2(r1.w);
  r1.w = UniformPixelScalars_1.x * r1.w;
  r1.w = exp2(r1.w);
  r1.w = r2.w ? 0 : r1.w;
  r4.xyz = r4.xyz * UniformPixelVector_6.xyz + -r3.xyz;
  r3.xyz = r1.www * r4.xyz + r3.xyz;
  r4.xyz = PixelTexture2D_4.SampleBias(PixelTexture2D_4Sampler_s, v4.xy, 0).xyz;
  r4.xyz = r4.xyz * float3(2,2,2) + float3(-1,-1,-1);
  r5.xz = UniformPixelVector_9.xy + v4.xy;
  r2.w = PixelTexture2D_3.SampleBias(PixelTexture2D_3Sampler_s, r5.xz, 0).y;
  r2.w = saturate(r5.w * 2 + r2.w);
  r3.w = cmp(r2.w < 9.99999997e-007);
  r2.w = log2(r2.w);
  r2.w = UniformPixelScalars_2.x * r2.w;
  r2.w = exp2(r2.w);
  r2.w = r3.w ? 0 : r2.w;
  r5.xz = -UniformPixelVector_9.xy + v4.xy;
  r3.w = PixelTexture2D_3.SampleBias(PixelTexture2D_3Sampler_s, r5.xz, 0).y;
  r3.w = saturate(r5.w * 2 + r3.w);
  r4.w = cmp(r3.w < 9.99999997e-007);
  r3.w = log2(r3.w);
  r3.w = UniformPixelScalars_2.x * r3.w;
  r3.w = exp2(r3.w);
  r3.w = r4.w ? -0 : -r3.w;
  r6.x = r3.w + r2.w;
  r5.xz = UniformPixelVector_10.xy + v4.xy;
  r2.w = PixelTexture2D_3.SampleBias(PixelTexture2D_3Sampler_s, r5.xz, 0).y;
  r2.w = saturate(r5.w * 2 + r2.w);
  r3.w = cmp(r2.w < 9.99999997e-007);
  r2.w = log2(r2.w);
  r2.w = UniformPixelScalars_2.x * r2.w;
  r2.w = exp2(r2.w);
  r2.w = r3.w ? 0 : r2.w;
  r5.xz = -UniformPixelVector_10.xy + v4.xy;
  r3.w = PixelTexture2D_3.SampleBias(PixelTexture2D_3Sampler_s, r5.xz, 0).y;
  r3.w = saturate(r5.w * 2 + r3.w);
  r4.w = cmp(r3.w < 9.99999997e-007);
  r3.w = log2(r3.w);
  r3.w = UniformPixelScalars_2.x * r3.w;
  r3.w = exp2(r3.w);
  r3.w = r4.w ? -0 : -r3.w;
  r6.y = r3.w + r2.w;
  r2.w = UniformPixelScalars_2.y;
  r6.xy = r2.ww * -r6.xy;
  r6.z = 0;
  r4.xyz = r4.xyz * UniformPixelVector_8.xyz + r6.xyz;
  r2.w = saturate(UniformPixelScalars_2.z * r5.y);
  r3.w = cmp(r2.w < 9.99999997e-007);
  r2.w = log2(r2.w);
  r2.w = UniformPixelScalars_2.x * r2.w;
  r2.w = exp2(r2.w);
  r2.w = r3.w ? 0 : r2.w;
  r4.xyz = r4.xyz + -r3.xyz;
  r3.xyz = r2.www * r4.xyz + r3.xyz;
  r2.xyz = r2.xyz * UniformPixelVector_2.xyz + r3.xyz;
  r3.x = dot(r2.xyz, r2.xyz);
  r3.x = sqrt(r3.x);
  r2.xyz = r2.xyz / r3.xxx;
  r3.x = dot(r2.xyz, r2.xyz);
  r3.x = rsqrt(r3.x);
  r2.xyz = r3.xxx * r2.xyz;
  r3.x = ShadowTexture.Sample(ShadowTextureSampler_s, v3.xy).x;
  r3.y = dot(v6.xyz, v6.xyz);
  r3.z = rsqrt(r3.y);
  r4.xyz = v6.xyz * r3.zzz;
  r3.z = dot(r4.xyz, -SpotDirection.xyz);
  r3.z = -SpotAngles.x + r3.z;
  r3.z = saturate(SpotAngles.y * r3.z);
  r3.z = r3.z * r3.z;
  r3.w = 1 + -r3.y;
  r3.w = r3.w * r3.x;
  r3.w = r3.w * r3.z;
  r3.w = cmp(r3.w < 0);
  if (r3.w != 0) discard;
  if (bReceiveDynamicShadows != 0) {
    r4.xyz = ViewProjectionMatrix._m01_m11_m31 * v8.yyy;
    r4.xyz = ViewProjectionMatrix._m00_m10_m30 * v8.xxx + r4.xyz;
    r4.xyz = ViewProjectionMatrix._m02_m12_m32 * v8.zzz + r4.xyz;

    r4.yzw = ViewProjectionMatrix._m03_m13_m33 * v8.www + r4.xyz;


float4 stereo = StereoParams.Load(0);
//r4.y += stereo.x*(r4.w - stereo.y);

    r3.w = cmp(0 != NvStereoEnabled);
    if (r3.w != 0) {
      r5.xy = NvStereoFixTexture.Sample(NvStereoFixTextureSampler_s, float2(0.0625,0)).xy;
      r5.y = -r5.y + r4.w;
      r4.x = r5.x * r5.y + r4.y;
      r5.xy = r4.xz;
      r4.x = r4.w;
    }
    if (r3.w == 0) {
      r5.xy = r4.yz;
      r4.x = r4.w;
    }
    r4.xy = r5.xy / r4.xx;
    r4.xy = r4.xy * ScreenPositionScaleBias.xy + ScreenPositionScaleBias.wz;
    r4.xyz = LightAttenuationTexture.Sample(LightAttenuationTextureSampler_s, r4.xy).xyz;
    r4.xyz = r4.xyz * r4.xyz;
    r4.xyz = r4.xyz * r3.xxx;
  } else {
    r4.xyz = r3.xxx;
  }
  r3.x = min(1, r3.y);
  r3.x = 1 + -r3.x;
  r3.x = log2(r3.x);
  r3.x = LightColorAndFalloffExponent.w * r3.x;
  r3.x = exp2(r3.x);
  r5.xyz = float3(1,1,1) + -UniformPixelVector_0.xyz;
  r6.xyz = PixelTexture2D_5.SampleBias(PixelTexture2D_5Sampler_s, v4.xy, 0).xyz;
  r6.xyz = UniformPixelVector_11.xyz * r6.xyz;
  r7.xyz = PixelTexture2D_6.SampleBias(PixelTexture2D_6Sampler_s, v4.xy, 0).xyz;
  r7.xyz = r7.xyz * UniformPixelVector_12.xyz + -r6.xyz;
  r6.xyz = r1.www * r7.xyz + r6.xyz;
  r7.xyz = PixelTexture2D_7.SampleBias(PixelTexture2D_7Sampler_s, v4.xy, 0).xyz;
  r7.xyz = r7.xyz * UniformPixelVector_13.xyz + -r6.xyz;
  r6.xyz = r2.www * r7.xyz + r6.xyz;
  r5.xyz = r6.xyz * r5.xyz;
  r5.xyz = r5.xyz * DiffuseOverrideParameter.www + DiffuseOverrideParameter.xyz;
  r3.y = -UniformPixelScalars_3.x + UniformPixelScalars_2.w;
  r3.y = r1.w * r3.y + UniformPixelScalars_3.x;
  r3.w = UniformPixelScalars_3.y + -r3.y;
  r3.y = r2.w * r3.w + r3.y;
  r6.xyz = r3.yyy * SpecularOverrideParameter.www + SpecularOverrideParameter.xyz;
  r3.y = PixelTexture2D_8.SampleBias(PixelTexture2D_8Sampler_s, v4.xy, 0).z;
  r3.w = UniformPixelScalars_3.z * r3.y;
  r3.y = -r3.y * UniformPixelScalars_3.z + UniformPixelScalars_4.x;
  r3.y = UniformPixelScalars_3.w * r3.y + r3.w;
  r3.w = PixelTexture2D_9.SampleBias(PixelTexture2D_9Sampler_s, v4.xy, 0).z;
  r4.w = UniformPixelScalars_4.y * r3.w;
  r3.w = -r3.w * UniformPixelScalars_4.y + UniformPixelScalars_4.x;
  r3.w = UniformPixelScalars_4.z * r3.w + r4.w;
  r3.w = r3.w + -r3.y;
  r3.y = r1.w * r3.w + r3.y;
  r3.w = -UniformPixelScalars_5.x + UniformPixelScalars_4.x;
  r3.w = UniformPixelScalars_4.w * r3.w + UniformPixelScalars_5.x;
  r3.w = r3.w + -r3.y;
  r3.y = r2.w * r3.w + r3.y;
  r3.w = UniformPixelScalars_5.y + -UniformPixelScalars_5.z;
  r1.w = r1.w * r3.w + UniformPixelScalars_5.z;
  r3.w = UniformPixelScalars_5.w + -r1.w;
  r1.w = r2.w * r3.w + r1.w;
  r7.xyz = -r5.xyz * r1.www + r5.xyz;
  r8.xyz = float3(0.0799999982,0.0799999982,0.0799999982) * r6.xyz;
  r5.xyz = -r6.xyz * float3(0.0799999982,0.0799999982,0.0799999982) + r5.xyz;
  r5.xyz = r1.www * r5.xyz + r8.xyz;
  r2.w = saturate(r6.x + r6.x);
  r2.w = -1 + r2.w;
  r1.w = r1.w * r2.w + 1;
  r5.xyz = r5.xyz * r1.www;
  r1.w = dot(r1.xyz, r1.xyz);
  r1.w = sqrt(r1.w);
  r1.xyz = r1.xyz * r1.www;
  r1.w = dot(r1.xyz, r1.xyz);
  r1.w = rsqrt(r1.w);
  r1.xyz = r1.xyz * r1.www;
  r1.w = saturate(dot(r2.xyz, r1.xyz));
  r2.w = max(0.0399999991, r3.y);
  r1.xyz = v7.xyz * r0.xxx + r1.xyz;
  r0.x = dot(r1.xyz, r1.xyz);
  r0.x = rsqrt(r0.x);
  r1.xyz = r1.xyz * r0.xxx;
  r0.x = dot(r2.xyz, r0.yzw);
  r0.x = 9.99999975e-006 + abs(r0.x);
  r2.x = saturate(dot(r2.xyz, r1.xyz));
  r0.y = saturate(dot(r0.yzw, r1.xyz));
  r0.z = r2.w * r2.w;
  r0.w = r0.z * r0.z;
  r1.x = r2.x * r0.w + -r2.x;
  r1.x = r1.x * r2.x + 1;
  r1.x = r1.x * r1.x;
  r1.x = 3.14159274 * r1.x;
  r0.w = r0.w / r1.x;
  r1.x = -r2.w * r2.w + 1;
  r1.y = r0.x * r1.x + r0.z;
  r0.z = r1.w * r1.x + r0.z;
  r0.x = r0.x * r0.z;
  r0.x = r1.w * r1.y + r0.x;
  r0.x = rcp(r0.x);
  r0.y = 1 + -r0.y;
  r0.xz = r0.wy * r0.xy;
  r0.z = r0.z * r0.z;
  r0.w = r0.y * r0.z;
  r1.x = saturate(50 * r5.y);
  r0.y = -r0.y * r0.z + 1;
  r2.xyz = r0.yyy * r5.xyz;
  r0.yzw = r1.xxx * r0.www + r2.xyz;
  r0.x = 0.5 * r0.x;
  r0.xyz = r0.xxx * r0.yzw;
  r0.xyz = r7.xyz * float3(0.318309873,0.318309873,0.318309873) + r0.xyz;
  r0.xyz = saturate(r0.xyz * r1.www);
  r0.xyz = r0.xyz * r4.xyz;
  r0.xyz = r0.xyz * r3.xxx;
  r0.xyz = LightColorAndFalloffExponent.xyz * r0.xyz;
  o0.xyz = r0.xyz * r3.zzz;
  o0.w = 0;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.39 on Sun Jun 26 04:15:09 2016
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   float4x4 LocalToWorld;             // Offset:    0 Size:    64 [unused]
//   float4x4 ScreenToWorldMatrix;      // Offset:   64 Size:    64 [unused]
//   bool bDecompressSceneColor;        // Offset:  128 Size:     4 [unused]
//   float4 PackedParameters;           // Offset:  144 Size:    16 [unused]
//   float4 MinMaxBlurClamp;            // Offset:  160 Size:    16 [unused]
//   float4 LightColorAndFalloffExponent;// Offset:  176 Size:    16
//   float3 DistanceFieldParameters;    // Offset:  192 Size:    12 [unused]
//   float4x4 ScreenToShadowMatrix;     // Offset:  208 Size:    64 [unused]
//   float4 ShadowBufferAndTexelSize;   // Offset:  272 Size:    16 [unused]
//   float ShadowOverrideFactor;        // Offset:  288 Size:     4 [unused]
//   float SSSMultiplier;               // Offset:  292 Size:     4 [unused]
//   bool bReceiveDynamicShadows;       // Offset:  296 Size:     4
//   bool bEnableDistanceShadowFading;  // Offset:  300 Size:     4 [unused]
//   float2 DistanceFadeParameters;     // Offset:  304 Size:     8 [unused]
//   float4 IBLPositionAndWeight0;      // Offset:  320 Size:    16 [unused]
//   float4 IBLPositionAndWeight1;      // Offset:  336 Size:    16 [unused]
//   float4 IBLPositionAndWeight2;      // Offset:  352 Size:    16 [unused]
//   float4 IBLPositionAndWeight3;      // Offset:  368 Size:    16 [unused]
//   float4x4 IBLProxyOBB0;             // Offset:  384 Size:    64 [unused]
//   float4x4 IBLProxyOBB1;             // Offset:  448 Size:    64 [unused]
//   float4x4 IBLProxyOBB2;             // Offset:  512 Size:    64 [unused]
//   float4 IBLUseProxyVolume;          // Offset:  576 Size:    16 [unused]
//   float4x4 IBLLastProxyOBB0;         // Offset:  592 Size:    64 [unused]
//   float4x4 IBLLastProxyOBB1;         // Offset:  656 Size:    64 [unused]
//   float4x4 IBLLastProxyOBB2;         // Offset:  720 Size:    64 [unused]
//   float4 IBLUseLastProxyVolume;      // Offset:  784 Size:    16 [unused]
//   float ForcedIBLWeight;             // Offset:  800 Size:     4 [unused]
//   float AdditionalReflections;       // Offset:  804 Size:     4 [unused]
//   float4x4 InvViewProjectionMatrix;  // Offset:  816 Size:    64 [unused]
//   float3 CameraWorldPos;             // Offset:  880 Size:    12 [unused]
//   float3 ActorWorldPos;              // Offset:  896 Size:    12 [unused]
//   float4 ObjectWorldPositionAndRadius;// Offset:  912 Size:    16 [unused]
//   float3 ObjectOrientation;          // Offset:  928 Size:    12 [unused]
//   float3 ObjectPostProjectionPosition;// Offset:  944 Size:    12 [unused]
//   float3 ObjectNDCPosition;          // Offset:  960 Size:    12 [unused]
//   float4 ObjectMacroUVScales;        // Offset:  976 Size:    16 [unused]
//   float3 FoliageImpulseDirection;    // Offset:  992 Size:    12 [unused]
//   float4 FoliageNormalizedRotationAxisAndAngle;// Offset: 1008 Size:    16 [unused]
//   float4 WindDirectionAndSpeed;      // Offset: 1024 Size:    16 [unused]
//   float3x3 LocalToWorldMatrix;       // Offset: 1040 Size:    44 [unused]
//   float3x3 WorldToLocalMatrix;       // Offset: 1088 Size:    44 [unused]
//   float3x3 WorldToViewMatrix;        // Offset: 1136 Size:    44 [unused]
//   float3x3 ViewToWorldMatrix;        // Offset: 1184 Size:    44 [unused]
//   float4 UniformPixelVector_0;       // Offset: 1232 Size:    16
//   float4 UniformPixelVector_1;       // Offset: 1248 Size:    16 [unused]
//   float4 UniformPixelVector_2;       // Offset: 1264 Size:    16
//   float4 UniformPixelVector_3;       // Offset: 1280 Size:    16 [unused]
//   float4 UniformPixelVector_4;       // Offset: 1296 Size:    16
//   float4 UniformPixelVector_5;       // Offset: 1312 Size:    16 [unused]
//   float4 UniformPixelVector_6;       // Offset: 1328 Size:    16
//   float4 UniformPixelVector_7;       // Offset: 1344 Size:    16 [unused]
//   float4 UniformPixelVector_8;       // Offset: 1360 Size:    16
//   float4 UniformPixelVector_9;       // Offset: 1376 Size:    16
//   float4 UniformPixelVector_10;      // Offset: 1392 Size:    16
//   float4 UniformPixelVector_11;      // Offset: 1408 Size:    16
//   float4 UniformPixelVector_12;      // Offset: 1424 Size:    16
//   float4 UniformPixelVector_13;      // Offset: 1440 Size:    16
//   float4 UniformPixelVector_14;      // Offset: 1456 Size:    16 [unused]
//   float4 UniformPixelScalars_0;      // Offset: 1472 Size:    16
//   float4 UniformPixelScalars_1;      // Offset: 1488 Size:    16
//   float4 UniformPixelScalars_2;      // Offset: 1504 Size:    16
//   float4 UniformPixelScalars_3;      // Offset: 1520 Size:    16
//   float4 UniformPixelScalars_4;      // Offset: 1536 Size:    16
//   float4 UniformPixelScalars_5;      // Offset: 1552 Size:    16
//   float3 TemporalAAParameters;       // Offset: 1568 Size:    12 [unused]
//   float4x4 PreviousLocalToWorld;     // Offset: 1584 Size:    64 [unused]
//   float LocalToWorldRotDeterminantFlip;// Offset: 1648 Size:     4 [unused]
//   float3x3 WorldToLocal;             // Offset: 1664 Size:    44 [unused]
//   float4 LightmapCoordinateScaleBias;// Offset: 1712 Size:    16 [unused]
//   float4 ShadowmapCoordinateScaleBias;// Offset: 1728 Size:    16 [unused]
//   float SubSurfaceQuality;           // Offset: 1744 Size:     4 [unused]
//   float3 SpotDirection;              // Offset: 1748 Size:    12
//   float2 SpotAngles;                 // Offset: 1760 Size:     8
//   float4 LightPositionAndInvRadius;  // Offset: 1776 Size:    16 [unused]
//
// }
//
// cbuffer VSOffsetConstants
// {
//
//   float4x4 ViewProjectionMatrix;     // Offset:    0 Size:    64
//   float4 CameraPositionVS;           // Offset:   64 Size:    16 [unused]
//   float4 PreViewTranslation;         // Offset:   80 Size:    16 [unused]
//
// }
//
// cbuffer PSOffsetConstants
// {
//
//   float4 ScreenPositionScaleBias;    // Offset:    0 Size:    16
//   float4 MinZ_MaxZRatio;             // Offset:   16 Size:    16 [unused]
//   float NvStereoEnabled;             // Offset:   32 Size:     4
//   float4 DiffuseOverrideParameter;   // Offset:   48 Size:    16
//   float4 SpecularOverrideParameter;  // Offset:   64 Size:    16
//   float4 CameraPositionPS;           // Offset:   80 Size:    16 [unused]
//   float4 ScreenAndTexelSize;         // Offset:   96 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// NvStereoFixTextureSampler         sampler      NA          NA    0        1
// LightAttenuationTextureSampler    sampler      NA          NA    1        1
// ShadowTextureSampler              sampler      NA          NA    2        1
// PixelTexture2D_0Sampler           sampler      NA          NA    3        1
// PixelTexture2D_1Sampler           sampler      NA          NA    4        1
// PixelTexture2D_2Sampler           sampler      NA          NA    5        1
// PixelTexture2D_3Sampler           sampler      NA          NA    6        1
// PixelTexture2D_4Sampler           sampler      NA          NA    7        1
// PixelTexture2D_5Sampler           sampler      NA          NA    8        1
// PixelTexture2D_6Sampler           sampler      NA          NA    9        1
// PixelTexture2D_7Sampler           sampler      NA          NA   10        1
// PixelTexture2D_8Sampler           sampler      NA          NA   11        1
// PixelTexture2D_9Sampler           sampler      NA          NA   12        1
// NvStereoFixTexture                texture  float4          2d    0        1
// LightAttenuationTexture           texture  float4          2d    1        1
// ShadowTexture                     texture  float4          2d    2        1
// PixelTexture2D_0                  texture  float4          2d    3        1
// PixelTexture2D_1                  texture  float4          2d    4        1
// PixelTexture2D_2                  texture  float4          2d    5        1
// PixelTexture2D_3                  texture  float4          2d    6        1
// PixelTexture2D_4                  texture  float4          2d    7        1
// PixelTexture2D_5                  texture  float4          2d    8        1
// PixelTexture2D_6                  texture  float4          2d    9        1
// PixelTexture2D_7                  texture  float4          2d   10        1
// PixelTexture2D_8                  texture  float4          2d   11        1
// PixelTexture2D_9                  texture  float4          2d   12        1
// $Globals                          cbuffer      NA          NA    0        1
// VSOffsetConstants                 cbuffer      NA          NA    1        1
// PSOffsetConstants                 cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                10   xyzw        0     NONE   float       
// TEXCOORD                11   xyzw        1     NONE   float       
// COLOR                    0   xyzw        2     NONE   float   xy  
// TEXCOORD                 0   xy          3     NONE   float   xy  
// TEXCOORD                 1   xyzw        4     NONE   float   xy  
// TEXCOORD                 4   xyz         5     NONE   float   xyz 
// TEXCOORD                 5   xyzw        6     NONE   float   xyz 
// TEXCOORD                 6   xyzw        7     NONE   float   xyz 
// TEXCOORD                 7   xyzw        8     NONE   float   xyzw
// SV_IsFrontFace           0   x           9    FFACE    uint       
//
//
// 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[111], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_constantbuffer cb2[5], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_sampler s7, mode_default
dcl_sampler s8, mode_default
dcl_sampler s9, mode_default
dcl_sampler s10, mode_default
dcl_sampler s11, mode_default
dcl_sampler s12, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t12
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xy
dcl_input_ps linear v4.xy
dcl_input_ps linear v5.xyz
dcl_input_ps linear v6.xyz
dcl_input_ps linear v7.xyz
dcl_input_ps linear v8.xyzw
dcl_output o0.xyzw
dcl_temps 9
dp3 r0.x, v7.xyzx, v7.xyzx
rsq r0.x, r0.x
mul r0.yzw, r0.xxxx, v7.xxyz
dp3 r1.x, v5.xyzx, v5.xyzx
rsq r1.x, r1.x
mul r1.xyz, r1.xxxx, v5.xyzx
sample_b_indexable(texture2d)(float,float,float,float) r2.xyz, v4.xyxx, t3.xyzw, s3, l(0.000000)
mad r2.xyz, r2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
sample_b_indexable(texture2d)(float,float,float,float) r3.xyz, v4.xyxx, t4.xyzw, s4, l(0.000000)
mad r3.xyz, r3.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mul r3.xyz, r3.xyzx, cb0[81].xyzx
sample_b_indexable(texture2d)(float,float,float,float) r4.xyz, v4.xyxx, t5.xyzw, s5, l(0.000000)
mad r4.xyz, r4.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
sample_b_indexable(texture2d)(float,float,float,float) r5.xy, v4.xyxx, t6.xyzw, s6, l(0.000000)
add r5.zw, v2.xxxy, l(0.000000, 0.000000, -0.500000, -0.500000)
mad r5.xy, r5.zwzz, l(2.000000, 2.000000, 0.000000, 0.000000), r5.xyxx
mul_sat r1.w, r5.x, cb0[92].w
lt r2.w, r1.w, l(0.000001)
log r1.w, r1.w
mul r1.w, r1.w, cb0[93].x
exp r1.w, r1.w
movc r1.w, r2.w, l(0), r1.w
mad r4.xyz, r4.xyzx, cb0[83].xyzx, -r3.xyzx
mad r3.xyz, r1.wwww, r4.xyzx, r3.xyzx
sample_b_indexable(texture2d)(float,float,float,float) r4.xyz, v4.xyxx, t7.xyzw, s7, l(0.000000)
mad r4.xyz, r4.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
add r5.xz, v4.xxyx, cb0[86].xxyx
sample_b_indexable(texture2d)(float,float,float,float) r2.w, r5.xzxx, t6.xzwy, s6, l(0.000000)
mad_sat r2.w, r5.w, l(2.000000), r2.w
lt r3.w, r2.w, l(0.000001)
log r2.w, r2.w
mul r2.w, r2.w, cb0[94].x
exp r2.w, r2.w
movc r2.w, r3.w, l(0), r2.w
add r5.xz, v4.xxyx, -cb0[86].xxyx
sample_b_indexable(texture2d)(float,float,float,float) r3.w, r5.xzxx, t6.xzwy, s6, l(0.000000)
mad_sat r3.w, r5.w, l(2.000000), r3.w
lt r4.w, r3.w, l(0.000001)
log r3.w, r3.w
mul r3.w, r3.w, cb0[94].x
exp r3.w, r3.w
movc r3.w, r4.w, l(-0.000000), -r3.w
add r6.x, r2.w, r3.w
add r5.xz, v4.xxyx, cb0[87].xxyx
sample_b_indexable(texture2d)(float,float,float,float) r2.w, r5.xzxx, t6.xzwy, s6, l(0.000000)
mad_sat r2.w, r5.w, l(2.000000), r2.w
lt r3.w, r2.w, l(0.000001)
log r2.w, r2.w
mul r2.w, r2.w, cb0[94].x
exp r2.w, r2.w
movc r2.w, r3.w, l(0), r2.w
add r5.xz, v4.xxyx, -cb0[87].xxyx
sample_b_indexable(texture2d)(float,float,float,float) r3.w, r5.xzxx, t6.xzwy, s6, l(0.000000)
mad_sat r3.w, r5.w, l(2.000000), r3.w
lt r4.w, r3.w, l(0.000001)
log r3.w, r3.w
mul r3.w, r3.w, cb0[94].x
exp r3.w, r3.w
movc r3.w, r4.w, l(-0.000000), -r3.w
add r6.y, r2.w, r3.w
mov r2.w, cb0[94].y
mul r6.xy, -r6.xyxx, r2.wwww
mov r6.z, l(0)
mad r4.xyz, r4.xyzx, cb0[85].xyzx, r6.xyzx
mul_sat r2.w, r5.y, cb0[94].z
lt r3.w, r2.w, l(0.000001)
log r2.w, r2.w
mul r2.w, r2.w, cb0[94].x
exp r2.w, r2.w
movc r2.w, r3.w, l(0), r2.w
add r4.xyz, -r3.xyzx, r4.xyzx
mad r3.xyz, r2.wwww, r4.xyzx, r3.xyzx
mad r2.xyz, r2.xyzx, cb0[79].xyzx, r3.xyzx
dp3 r3.x, r2.xyzx, r2.xyzx
sqrt r3.x, r3.x
div r2.xyz, r2.xyzx, r3.xxxx
dp3 r3.x, r2.xyzx, r2.xyzx
rsq r3.x, r3.x
mul r2.xyz, r2.xyzx, r3.xxxx
sample_indexable(texture2d)(float,float,float,float) r3.x, v3.xyxx, t2.xyzw, s2
dp3 r3.y, v6.xyzx, v6.xyzx
rsq r3.z, r3.y
mul r4.xyz, r3.zzzz, v6.xyzx
dp3 r3.z, r4.xyzx, -cb0[109].yzwy
add r3.z, r3.z, -cb0[110].x
mul_sat r3.z, r3.z, cb0[110].y
mul r3.z, r3.z, r3.z
add r3.w, -r3.y, l(1.000000)
mul r3.w, r3.x, r3.w
mul r3.w, r3.z, r3.w
lt r3.w, r3.w, l(0.000000)
discard_nz r3.w
if_nz cb0[18].z
  mul r4.xyz, v8.yyyy, cb1[1].xywx
  mad r4.xyz, cb1[0].xywx, v8.xxxx, r4.xyzx
  mad r4.xyz, cb1[2].xywx, v8.zzzz, r4.xyzx
  mad r4.yzw, cb1[3].xxyw, v8.wwww, r4.xxyz
  ne r3.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[2].x
  if_nz r3.w
    sample_indexable(texture2d)(float,float,float,float) r5.xy, l(0.062500, 0.000000, 0.000000, 0.000000), t0.xyzw, s0
    add r5.y, r4.w, -r5.y
    mad r4.x, r5.x, r5.y, r4.y
    mov r5.xy, r4.xzxx
    mov r4.x, r4.w
  endif 
  if_z r3.w
    mov r5.xy, r4.yzyy
    mov r4.x, r4.w
  endif 
  div r4.xy, r5.xyxx, r4.xxxx
  mad r4.xy, r4.xyxx, cb2[0].xyxx, cb2[0].wzww
  sample_indexable(texture2d)(float,float,float,float) r4.xyz, r4.xyxx, t1.xyzw, s1
  mul r4.xyz, r4.xyzx, r4.xyzx
  mul r4.xyz, r3.xxxx, r4.xyzx
else 
  mov r4.xyz, r3.xxxx
endif 
min r3.x, r3.y, l(1.000000)
add r3.x, -r3.x, l(1.000000)
log r3.x, r3.x
mul r3.x, r3.x, cb0[11].w
exp r3.x, r3.x
add r5.xyz, -cb0[77].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
sample_b_indexable(texture2d)(float,float,float,float) r6.xyz, v4.xyxx, t8.xyzw, s8, l(0.000000)
mul r6.xyz, r6.xyzx, cb0[88].xyzx
sample_b_indexable(texture2d)(float,float,float,float) r7.xyz, v4.xyxx, t9.xyzw, s9, l(0.000000)
mad r7.xyz, r7.xyzx, cb0[89].xyzx, -r6.xyzx
mad r6.xyz, r1.wwww, r7.xyzx, r6.xyzx
sample_b_indexable(texture2d)(float,float,float,float) r7.xyz, v4.xyxx, t10.xyzw, s10, l(0.000000)
mad r7.xyz, r7.xyzx, cb0[90].xyzx, -r6.xyzx
mad r6.xyz, r2.wwww, r7.xyzx, r6.xyzx
mul r5.xyz, r5.xyzx, r6.xyzx
mad r5.xyz, r5.xyzx, cb2[3].wwww, cb2[3].xyzx
add r3.y, cb0[94].w, -cb0[95].x
mad r3.y, r1.w, r3.y, cb0[95].x
add r3.w, -r3.y, cb0[95].y
mad r3.y, r2.w, r3.w, r3.y
mad r6.xyz, r3.yyyy, cb2[4].wwww, cb2[4].xyzx
sample_b_indexable(texture2d)(float,float,float,float) r3.y, v4.xyxx, t11.xzyw, s11, l(0.000000)
mul r3.w, r3.y, cb0[95].z
mad r3.y, -r3.y, cb0[95].z, cb0[96].x
mad r3.y, cb0[95].w, r3.y, r3.w
sample_b_indexable(texture2d)(float,float,float,float) r3.w, v4.xyxx, t12.xywz, s12, l(0.000000)
mul r4.w, r3.w, cb0[96].y
mad r3.w, -r3.w, cb0[96].y, cb0[96].x
mad r3.w, cb0[96].z, r3.w, r4.w
add r3.w, -r3.y, r3.w
mad r3.y, r1.w, r3.w, r3.y
add r3.w, cb0[96].x, -cb0[97].x
mad r3.w, cb0[96].w, r3.w, cb0[97].x
add r3.w, -r3.y, r3.w
mad r3.y, r2.w, r3.w, r3.y
add r3.w, -cb0[97].z, cb0[97].y
mad r1.w, r1.w, r3.w, cb0[97].z
add r3.w, -r1.w, cb0[97].w
mad r1.w, r2.w, r3.w, r1.w
mad r7.xyz, -r5.xyzx, r1.wwww, r5.xyzx
mul r8.xyz, r6.xyzx, l(0.080000, 0.080000, 0.080000, 0.000000)
mad r5.xyz, -r6.xyzx, l(0.080000, 0.080000, 0.080000, 0.000000), r5.xyzx
mad r5.xyz, r1.wwww, r5.xyzx, r8.xyzx
add_sat r2.w, r6.x, r6.x
add r2.w, r2.w, l(-1.000000)
mad r1.w, r1.w, r2.w, l(1.000000)
mul r5.xyz, r1.wwww, r5.xyzx
dp3 r1.w, r1.xyzx, r1.xyzx
sqrt r1.w, r1.w
mul r1.xyz, r1.wwww, r1.xyzx
dp3 r1.w, r1.xyzx, r1.xyzx
rsq r1.w, r1.w
mul r1.xyz, r1.wwww, r1.xyzx
dp3_sat r1.w, r2.xyzx, r1.xyzx
max r2.w, r3.y, l(0.040000)
mad r1.xyz, v7.xyzx, r0.xxxx, r1.xyzx
dp3 r0.x, r1.xyzx, r1.xyzx
rsq r0.x, r0.x
mul r1.xyz, r0.xxxx, r1.xyzx
dp3 r0.x, r2.xyzx, r0.yzwy
add r0.x, |r0.x|, l(0.000010)
dp3_sat r2.x, r2.xyzx, r1.xyzx
dp3_sat r0.y, r0.yzwy, r1.xyzx
mul r0.z, r2.w, r2.w
mul r0.w, r0.z, r0.z
mad r1.x, r2.x, r0.w, -r2.x
mad r1.x, r1.x, r2.x, l(1.000000)
mul r1.x, r1.x, r1.x
mul r1.x, r1.x, l(3.14159274)
div r0.w, r0.w, r1.x
mad r1.x, -r2.w, r2.w, l(1.000000)
mad r1.y, r0.x, r1.x, r0.z
mad r0.z, r1.w, r1.x, r0.z
mul r0.x, r0.z, r0.x
mad r0.x, r1.w, r1.y, r0.x
rcp r0.x, r0.x
add r0.y, -r0.y, l(1.000000)
mul r0.xz, r0.xxyx, r0.wwyw
mul r0.z, r0.z, r0.z
mul r0.w, r0.z, r0.y
mul_sat r1.x, r5.y, l(50.000000)
mad r0.y, -r0.y, r0.z, l(1.000000)
mul r2.xyz, r5.xyzx, r0.yyyy
mad r0.yzw, r1.xxxx, r0.wwww, r2.xxyz
mul r0.x, r0.x, l(0.500000)
mul r0.xyz, r0.yzwy, r0.xxxx
mad r0.xyz, r7.xyzx, l(0.318309873, 0.318309873, 0.318309873, 0.000000), r0.xyzx
mul_sat r0.xyz, r1.wwww, r0.xyzx
mul r0.xyz, r4.xyzx, r0.xyzx
mul r0.xyz, r3.xxxx, r0.xyzx
mul r0.xyz, r0.xyzx, cb0[11].xyzx
mul o0.xyz, r3.zzzz, r0.xyzx
mov o0.w, l(0)
ret 
// Approximately 211 instruction slots used

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