//blue figures (imagination talent)
// ---- Created with 3Dmigoto v1.2.39 on Mon Jun 20 04:23:58 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);
  float3 FogVolumeDensityParameters : packoffset(c65);
  float4 FogVolumeHalfspaceParameters : packoffset(c66);
  float3 ApproxFogColor : packoffset(c67);
  float3 FogVolumeBoxMin : packoffset(c68);
  float3 FogVolumeBoxMax : packoffset(c69);
  float3x3 LocalToWorldMatrix : packoffset(c70);
  float3x3 WorldToLocalMatrix : packoffset(c73);
  float3x3 WorldToViewMatrix : packoffset(c76);
  float3x3 ViewToWorldMatrix : packoffset(c79);
  float4 UniformPixelVector_0 : packoffset(c82);
  float4 UniformPixelVector_1 : packoffset(c83);
  float4 UniformPixelVector_2 : packoffset(c84);
  float4 UniformPixelVector_3 : packoffset(c85);
  float4 UniformPixelVector_4 : packoffset(c86);
  float4 UniformPixelVector_5 : packoffset(c87);
  float4 UniformPixelScalars_0 : packoffset(c88);
  float4 UniformPixelScalars_1 : packoffset(c89);
  float4 UniformPixelScalars_2 : packoffset(c90);
  float4 UniformPixelScalars_3 : packoffset(c91);
  float4 UniformPixelScalars_4 : packoffset(c92);
  float3 TemporalAAParameters : packoffset(c93);
  float4x3 WorldToLocal : packoffset(c94);
  float4x4 PreviousLocalToWorld : packoffset(c97);
  float3 MeshOrigin : packoffset(c101);
  float3 MeshExtension : packoffset(c102);
  float4 BoneIndexOffsetAndScale : packoffset(c103);
  float SubSurfaceQuality : packoffset(c104);
  float4 DeferredRenderingParameters : packoffset(c105);
  float2 TemporalAAParametersPS : packoffset(c106);
  float3 SpotDirection : packoffset(c107);
  float2 SpotAngles : packoffset(c108);
  float3 UpperSkyColor : packoffset(c109);
  float3 LowerSkyColor : packoffset(c110);
  float UseOnlyLightMapSpecular : packoffset(c110.w);
  float4 AmbientColorAndSkyFactor : packoffset(c111);
  float EmissiveMultiplier : packoffset(c112);
  float DiffuseMultiplier : packoffset(c112.y);
}

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 SceneColorTextureSampler_s : register(s0);
SamplerState AmbientReflectionCubemapSampler_s : register(s1);
SamplerState PixelTexture2D_0Sampler_s : register(s2);
SamplerState PixelTexture2D_1Sampler_s : register(s3);
Texture2D<float4> SceneColorTexture : register(t0);
TextureCube<float4> AmbientReflectionCubemap : register(t1);
Texture2D<float4> PixelTexture2D_0 : register(t2);
Texture2D<float4> PixelTexture2D_1 : register(t3);


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


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

  r0.xyz = CameraWorldPos.xyz + v7.xyz;
  r1.xyz = ViewProjectionMatrix._m01_m11_m31 * v7.yyy;
  r1.xyz = ViewProjectionMatrix._m00_m10_m30 * v7.xxx + r1.xyz;
  r1.xyz = ViewProjectionMatrix._m02_m12_m32 * v7.zzz + r1.xyz;
  r1.xyz = ViewProjectionMatrix._m03_m13_m33 * v7.www + r1.xyz;

float4 stereo = StereoParams.Load(0);
r1.x += stereo.x*(r1.z - stereo.y);

  r0.w = dot(v5.xyz, v5.xyz);
  r0.w = rsqrt(r0.w);
  r0.w = v5.z * r0.w;
  r2.xyzw = DiffuseOverrideParameter.yxyz * DiffuseMultiplier;
  r1.xy = r1.xy / r1.zz;
  r1.xy = r1.xy * ScreenPositionScaleBias.xy + ScreenPositionScaleBias.wz;
  r1.xyz = SceneColorTexture.Sample(SceneColorTextureSampler_s, r1.xy).xyz;
  r1.w = r1.x + r1.y;
  r1.w = r1.w + r1.z;
  r3.xy = cmp(float2(0.0240000002,0.600000024) < r1.ww);
  r3.zw = cmp(r1.ww < float2(0.600000024,3));
  r3.xy = r3.zw ? r3.xy : 0;
  r4.xyz = float3(0.280898869,0.225148901,0.132721543) * r1.www;
  r3.yzw = r3.yyy ? float3(0.421348304,0.337723345,0.199082315) : r4.xyz;
  r3.xyz = r3.xxx ? float3(0.126404494,0.101317003,0.059724696) : r3.yzw;
  r4.xy = UniformPixelVector_2.xy + v3.xy;
  r1.w = PixelTexture2D_0.SampleBias(PixelTexture2D_0Sampler_s, r4.xy, 0).y;
  r1.w = 1 + -r1.w;
  r4.xy = UniformPixelVector_3.xy + v3.xy;
  r3.w = PixelTexture2D_0.SampleBias(PixelTexture2D_0Sampler_s, r4.xy, 0).y;
  r3.w = 1 + -r3.w;
  r1.w = r3.w * r1.w;
  r3.w = PixelTexture2D_0.SampleBias(PixelTexture2D_0Sampler_s, v3.xy, 0).x;
  r1.w = r1.w * 0.200000003 + r3.w;
  r0.w = max(0, r0.w);
  r0.w = 1 + -r0.w;
  r3.w = cmp(abs(r0.w) < 9.99999997e-007);
  r4.x = abs(r0.w) * abs(r0.w);
  r4.y = r4.x * r4.x;
  r4.x = r4.x * r4.y;
  r4.x = r3.w ? 0 : r4.x;
  r1.w = r1.w * 0.600000024 + r4.x;
  r1.w = saturate(0.800000012 + r1.w);
  r3.xyz = -UniformPixelVector_1.xyz + r3.xyz;
  r3.xyz = r1.www * r3.xyz + UniformPixelVector_1.xyz;
  r1.w = dot(r1.xyz, float3(0.300000012,0.589999974,0.109999999));
  r4.xyz = r1.www + -r1.xyz;
  r1.xyz = r4.xyz * float3(0.5,0.5,0.5) + r1.xyz;
  r4.xyz = float3(0.842696607,0.675446689,0.39816463) * r1.xyz;
  r0.w = log2(abs(r0.w));
  r0.w = 0.200000003 * r0.w;
  r0.w = exp2(r0.w);
  r0.w = 1 + -r0.w;
  r0.w = r3.w ? 1 : r0.w;
  r5.yzw = float3(0.00800000038,0.00800000038,0.00800000038) * r0.xyz;
  r5.x = r5.y + r5.z;
  r0.xy = UniformPixelVector_4.xy + r5.xw;
  r0.x = PixelTexture2D_1.SampleBias(PixelTexture2D_1Sampler_s, r0.xy, 0).x;
  r0.yz = UniformPixelVector_5.xy + r5.xw;
  r0.y = PixelTexture2D_1.SampleBias(PixelTexture2D_1Sampler_s, r0.yz, 0).x;
  r0.x = r0.x * r0.y;
  r0.y = cmp(abs(r0.x) < 9.99999997e-007);
  r0.x = abs(r0.x) * abs(r0.x);
  r0.x = r0.y ? 0 : r0.x;
  r0.x = r0.w * r0.x;
  r0.yzw = -r1.xyz * float3(0.842696607,0.675446689,0.39816463) + float3(0.183338314,0.386256456,0.387640446);
  r0.xyz = r0.xxx * r0.yzw + r4.xyz;
  r0.xyz = r0.xyz + -r3.xyz;
  r0.xyz = UniformPixelScalars_4.yyy * r0.xyz + r3.xyz;
  r0.xyz = UniformPixelVector_0.xyz + r0.xyz;
  r0.w = dot(v6.xyz, v6.xyz);
  r0.w = rsqrt(r0.w);
  r0.w = v6.z * r0.w;
  r1.xy = r0.ww * float2(0.5,-0.5) + float2(0.5,0.5);
  r1.xy = r1.xy * r1.xy;
  r1.xzw = r2.yzw * r1.xxx;
  r3.xyz = r2.yzw * r1.yyy;
  r3.xyz = LowerSkyColor.xyz * r3.xyz;
  r1.xyz = r1.xzw * UpperSkyColor.xyz + r3.xyz;
  r1.xyz = AmbientColorAndSkyFactor.www * r1.xyz;
  r0.xyz = r0.xyz * EmissiveMultiplier + r1.xyz;
  r0.xyz = r2.yzw * AmbientColorAndSkyFactor.xyz + r0.xyz;
  r0.w = cmp(0 < AdditionalReflections);
  if (r0.w != 0) {
    r0.w = dot(v1.xyz, v1.xyz);
    r0.w = rsqrt(r0.w);
    r1.xyz = v1.xyz * r0.www;
    r0.w = dot(v0.xyz, v0.xyz);
    r0.w = rsqrt(r0.w);
    r3.xyz = v0.xyz * r0.www;
    r0.w = r3.x * r1.y;
    r0.w = r1.x * r3.y + -r0.w;
    r1.y = v1.w * r0.w;
    r0.w = saturate(SpecularOverrideParameter.x + SpecularOverrideParameter.x);
    r2.xyzw = r2.xyzw * r0.wwww;
    r0.w = dot(v7.xyz, v7.xyz);
    r0.w = rsqrt(r0.w);
    r3.xyw = v7.xyz * r0.www;
    r1.x = r3.z;
    r0.w = dot(r3.xyw, r1.xyz);
    r0.w = r0.w + r0.w;
    r1.xyz = r1.xyz * -r0.www + r3.xyw;
    r1.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r1.xyz, 5).xyz;
    r2.xyzw = float4(50,0.452399999,0.452399999,0.452399999) * r2.xyzw;
    r2.x = saturate(r2.x);
    r2.xyz = r2.xxx * float3(-0.00240000011,-0.00240000011,-0.00240000011) + r2.yzw;
    r1.xyz = r2.xyz * r1.xyz;
    r0.xyz = r1.xyz * AdditionalReflections + r0.xyz;
  }
  r0.w = cmp(AdditionalReflections < 0);
  r1.xyz = r0.xyz / -AdditionalReflections;
  r0.xyz = r0.www ? r1.xyz : r0.xyz;
  o0.xyz = r0.xyz * v4.www + v4.xyz;
  o0.w = UniformPixelScalars_4.z;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.39 on Mon Jun 20 04:23:58 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 [unused]
//   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 [unused]
//   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
//   float4x4 InvViewProjectionMatrix;  // Offset:  816 Size:    64 [unused]
//   float3 CameraWorldPos;             // Offset:  880 Size:    12
//   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]
//   float3 FogVolumeDensityParameters; // Offset: 1040 Size:    12 [unused]
//   float4 FogVolumeHalfspaceParameters;// Offset: 1056 Size:    16 [unused]
//   float3 ApproxFogColor;             // Offset: 1072 Size:    12 [unused]
//   float3 FogVolumeBoxMin;            // Offset: 1088 Size:    12 [unused]
//   float3 FogVolumeBoxMax;            // Offset: 1104 Size:    12 [unused]
//   float3x3 LocalToWorldMatrix;       // Offset: 1120 Size:    44 [unused]
//   float3x3 WorldToLocalMatrix;       // Offset: 1168 Size:    44 [unused]
//   float3x3 WorldToViewMatrix;        // Offset: 1216 Size:    44 [unused]
//   float3x3 ViewToWorldMatrix;        // Offset: 1264 Size:    44 [unused]
//   float4 UniformPixelVector_0;       // Offset: 1312 Size:    16
//   float4 UniformPixelVector_1;       // Offset: 1328 Size:    16
//   float4 UniformPixelVector_2;       // Offset: 1344 Size:    16
//   float4 UniformPixelVector_3;       // Offset: 1360 Size:    16
//   float4 UniformPixelVector_4;       // Offset: 1376 Size:    16
//   float4 UniformPixelVector_5;       // Offset: 1392 Size:    16
//   float4 UniformPixelScalars_0;      // Offset: 1408 Size:    16 [unused]
//   float4 UniformPixelScalars_1;      // Offset: 1424 Size:    16 [unused]
//   float4 UniformPixelScalars_2;      // Offset: 1440 Size:    16 [unused]
//   float4 UniformPixelScalars_3;      // Offset: 1456 Size:    16 [unused]
//   float4 UniformPixelScalars_4;      // Offset: 1472 Size:    16
//   float3 TemporalAAParameters;       // Offset: 1488 Size:    12 [unused]
//   float4x3 WorldToLocal;             // Offset: 1504 Size:    48 [unused]
//   float4x4 PreviousLocalToWorld;     // Offset: 1552 Size:    64 [unused]
//   float3 MeshOrigin;                 // Offset: 1616 Size:    12 [unused]
//   float3 MeshExtension;              // Offset: 1632 Size:    12 [unused]
//   float4 BoneIndexOffsetAndScale;    // Offset: 1648 Size:    16 [unused]
//   float SubSurfaceQuality;           // Offset: 1664 Size:     4 [unused]
//   float4 DeferredRenderingParameters;// Offset: 1680 Size:    16 [unused]
//   float2 TemporalAAParametersPS;     // Offset: 1696 Size:     8 [unused]
//   float3 SpotDirection;              // Offset: 1712 Size:    12 [unused]
//   float2 SpotAngles;                 // Offset: 1728 Size:     8 [unused]
//   float3 UpperSkyColor;              // Offset: 1744 Size:    12
//   float3 LowerSkyColor;              // Offset: 1760 Size:    12
//   float UseOnlyLightMapSpecular;     // Offset: 1772 Size:     4 [unused]
//   float4 AmbientColorAndSkyFactor;   // Offset: 1776 Size:    16
//   float EmissiveMultiplier;          // Offset: 1792 Size:     4
//   float DiffuseMultiplier;           // Offset: 1796 Size:     4
//
// }
//
// 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 [unused]
//   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
// ------------------------------ ---------- ------- ----------- ---- --------
// SceneColorTextureSampler          sampler      NA          NA    0        1
// AmbientReflectionCubemapSampler    sampler      NA          NA    1        1
// PixelTexture2D_0Sampler           sampler      NA          NA    2        1
// PixelTexture2D_1Sampler           sampler      NA          NA    3        1
// SceneColorTexture                 texture  float4          2d    0        1
// AmbientReflectionCubemap          texture  float4        cube    1        1
// PixelTexture2D_0                  texture  float4          2d    2        1
// PixelTexture2D_1                  texture  float4          2d    3        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   xyz 
// TEXCOORD                11   xyzw        1     NONE   float   xyzw
// COLOR                    0   xyzw        2     NONE   float       
// TEXCOORD                 0   xy          3     NONE   float   xy  
// TEXCOORD                 4   xyzw        4     NONE   float   xyzw
// TEXCOORD                 6   xyzw        5     NONE   float   xyz 
// TEXCOORD                 7   xyz         6     NONE   float   xyz 
// TEXCOORD                 5   xyzw        7     NONE   float   xyzw
// SV_IsFrontFace           0   x           8    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[113], 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_resource_texture2d (float,float,float,float) t0
dcl_resource_texturecube (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_input_ps linear centroid v0.xyz
dcl_input_ps linear centroid v1.xyzw
dcl_input_ps linear v3.xy
dcl_input_ps linear v4.xyzw
dcl_input_ps linear v5.xyz
dcl_input_ps linear v6.xyz
dcl_input_ps linear v7.xyzw
dcl_output o0.xyzw
dcl_temps 6
add r0.xyz, v7.xyzx, cb0[55].xyzx
mul r1.xyz, v7.yyyy, cb1[1].xywx
mad r1.xyz, cb1[0].xywx, v7.xxxx, r1.xyzx
mad r1.xyz, cb1[2].xywx, v7.zzzz, r1.xyzx
mad r1.xyz, cb1[3].xywx, v7.wwww, r1.xyzx
dp3 r0.w, v5.xyzx, v5.xyzx
rsq r0.w, r0.w
mul r0.w, r0.w, v5.z
mul r2.xyzw, cb0[112].yyyy, cb2[3].yxyz
div r1.xy, r1.xyxx, r1.zzzz
mad r1.xy, r1.xyxx, cb2[0].xyxx, cb2[0].wzww
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t0.xyzw, s0
add r1.w, r1.y, r1.x
add r1.w, r1.z, r1.w
lt r3.xy, l(0.024000, 0.600000, 0.000000, 0.000000), r1.wwww
lt r3.zw, r1.wwww, l(0.000000, 0.000000, 0.600000, 3.000000)
and r3.xy, r3.zwzz, r3.xyxx
mul r4.xyz, r1.wwww, l(0.280898869, 0.225148901, 0.132721543, 0.000000)
movc r3.yzw, r3.yyyy, l(0,0.421348304,0.337723345,0.199082315), r4.xxyz
movc r3.xyz, r3.xxxx, l(0.126404494,0.101317,0.0597246960,0), r3.yzwy
add r4.xy, v3.xyxx, cb0[84].xyxx
sample_b_indexable(texture2d)(float,float,float,float) r1.w, r4.xyxx, t2.xzwy, s2, l(0.000000)
add r1.w, -r1.w, l(1.000000)
add r4.xy, v3.xyxx, cb0[85].xyxx
sample_b_indexable(texture2d)(float,float,float,float) r3.w, r4.xyxx, t2.xzwy, s2, l(0.000000)
add r3.w, -r3.w, l(1.000000)
mul r1.w, r1.w, r3.w
sample_b_indexable(texture2d)(float,float,float,float) r3.w, v3.xyxx, t2.yzwx, s2, l(0.000000)
mad r1.w, r1.w, l(0.200000), r3.w
max r0.w, r0.w, l(0.000000)
add r0.w, -r0.w, l(1.000000)
lt r3.w, |r0.w|, l(0.000001)
mul r4.x, |r0.w|, |r0.w|
mul r4.y, r4.x, r4.x
mul r4.x, r4.y, r4.x
movc r4.x, r3.w, l(0), r4.x
mad r1.w, r1.w, l(0.600000), r4.x
add_sat r1.w, r1.w, l(0.800000)
add r3.xyz, r3.xyzx, -cb0[83].xyzx
mad r3.xyz, r1.wwww, r3.xyzx, cb0[83].xyzx
dp3 r1.w, r1.xyzx, l(0.300000, 0.590000, 0.110000, 0.000000)
add r4.xyz, -r1.xyzx, r1.wwww
mad r1.xyz, r4.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r1.xyzx
mul r4.xyz, r1.xyzx, l(0.842696607, 0.675446689, 0.398164630, 0.000000)
log r0.w, |r0.w|
mul r0.w, r0.w, l(0.200000)
exp r0.w, r0.w
add r0.w, -r0.w, l(1.000000)
movc r0.w, r3.w, l(1.000000), r0.w
mul r5.yzw, r0.xxyz, l(0.000000, 0.008000, 0.008000, 0.008000)
add r5.x, r5.z, r5.y
add r0.xy, r5.xwxx, cb0[86].xyxx
sample_b_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t3.xyzw, s3, l(0.000000)
add r0.yz, r5.xxwx, cb0[87].xxyx
sample_b_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t3.yxzw, s3, l(0.000000)
mul r0.x, r0.y, r0.x
lt r0.y, |r0.x|, l(0.000001)
mul r0.x, |r0.x|, |r0.x|
movc r0.x, r0.y, l(0), r0.x
mul r0.x, r0.x, r0.w
mad r0.yzw, -r1.xxyz, l(0.000000, 0.842696607, 0.675446689, 0.398164630), l(0.000000, 0.183338314, 0.386256456, 0.387640446)
mad r0.xyz, r0.xxxx, r0.yzwy, r4.xyzx
add r0.xyz, -r3.xyzx, r0.xyzx
mad r0.xyz, cb0[92].yyyy, r0.xyzx, r3.xyzx
add r0.xyz, r0.xyzx, cb0[82].xyzx
dp3 r0.w, v6.xyzx, v6.xyzx
rsq r0.w, r0.w
mul r0.w, r0.w, v6.z
mad r1.xy, r0.wwww, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
mul r1.xy, r1.xyxx, r1.xyxx
mul r1.xzw, r1.xxxx, r2.yyzw
mul r3.xyz, r1.yyyy, r2.yzwy
mul r3.xyz, r3.xyzx, cb0[110].xyzx
mad r1.xyz, r1.xzwx, cb0[109].xyzx, r3.xyzx
mul r1.xyz, r1.xyzx, cb0[111].wwww
mad r0.xyz, r0.xyzx, cb0[112].xxxx, r1.xyzx
mad r0.xyz, r2.yzwy, cb0[111].xyzx, r0.xyzx
lt r0.w, l(0.000000), cb0[50].y
if_nz r0.w
  dp3 r0.w, v1.xyzx, v1.xyzx
  rsq r0.w, r0.w
  mul r1.xyz, r0.wwww, v1.xyzx
  dp3 r0.w, v0.xyzx, v0.xyzx
  rsq r0.w, r0.w
  mul r3.xyz, r0.wwww, v0.xyzx
  mul r0.w, r1.y, r3.x
  mad r0.w, r1.x, r3.y, -r0.w
  mul r1.y, r0.w, v1.w
  add_sat r0.w, cb2[4].x, cb2[4].x
  mul r2.xyzw, r0.wwww, r2.xyzw
  dp3 r0.w, v7.xyzx, v7.xyzx
  rsq r0.w, r0.w
  mul r3.xyw, r0.wwww, v7.xyxz
  mov r1.x, r3.z
  dp3 r0.w, r3.xywx, r1.xyzx
  add r0.w, r0.w, r0.w
  mad r1.xyz, r1.xyzx, -r0.wwww, r3.xywx
  sample_l_indexable(texturecube)(float,float,float,float) r1.xyz, r1.xyzx, t1.xyzw, s1, l(5.000000)
  mul r2.xyzw, r2.xyzw, l(50.000000, 0.452400, 0.452400, 0.452400)
  mov_sat r2.x, r2.x
  mad r2.xyz, r2.xxxx, l(-0.002400, -0.002400, -0.002400, 0.000000), r2.yzwy
  mul r1.xyz, r1.xyzx, r2.xyzx
  mad r0.xyz, r1.xyzx, cb0[50].yyyy, r0.xyzx
endif 
lt r0.w, cb0[50].y, l(0.000000)
div r1.xyz, r0.xyzx, -cb0[50].yyyy
movc r0.xyz, r0.wwww, r1.xyzx, r0.xyzx
mad o0.xyz, r0.xyzx, v4.wwww, v4.xyzx
mov o0.w, cb0[92].z
ret 
// Approximately 110 instruction slots used

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