//Mission 12 cutscene 6 haloing PS.
// ---- Created with 3Dmigoto v1.3.15-re2_workaround on Mon Mar 11 20:26:29 2019

cbuffer SceneInfo : register(b0)
{
  row_major float4x4 viewProjMat : packoffset(c0);
  row_major float3x4 transposeViewMat : packoffset(c4);
  row_major float3x4 transposeViewInvMat : packoffset(c7);
  float4 projElement[2] : packoffset(c10);
  float4 projInvElements[2] : packoffset(c12);
  row_major float4x4 viewProjInvMat : packoffset(c14);
  row_major float4x4 prevViewProjMat : packoffset(c18);
  float3 ZToLinear : packoffset(c22);
  float subdivisionLevel : packoffset(c22.w);
  float2 screenSize : packoffset(c23);
  float2 screenInverseSize : packoffset(c23.z);
  float2 cullingHelper : packoffset(c24);
  float cameraNearPlane : packoffset(c24.z);
  float cameraFarPlane : packoffset(c24.w);
  float4 viewFrustum[6] : packoffset(c25);
  float4 clipplane : packoffset(c31);
}

cbuffer EnvironmentInfo : register(b1)
{
  uint timeMillisecond : packoffset(c0);
  uint frameCount : packoffset(c0.y);
  uint isOddFrame : packoffset(c0.z);
  uint reserveEnvironmentInfo : packoffset(c0.w);
  row_major float4x4 userGlobalParams : packoffset(c1);
  float breakingPBRSpecularIntensity : packoffset(c5);
  float breakingPBRIBLReflectanceBias : packoffset(c5.y);
  float breakingPBRIBLIntensity : packoffset(c5.z);
  float breakingPBR_Reserved : packoffset(c5.w);
}

cbuffer UserMaterial : register(b2)
{
  float4 VAR_ColorParam : packoffset(c0);
  float4 VAR_LowColor : packoffset(c1);
  float4 VAR_UV_Tilling : packoffset(c2);
  float4 VAR_Normal_UV_Tilling : packoffset(c3);
  float VAR_Base_Intensity : packoffset(c4);
  float VAR_Back_Intensity : packoffset(c4.y);
  float VAR_FlowIntensity : packoffset(c4.z);
  float VAR_Flow_Speed : packoffset(c4.w);
  float VAR_RefractiveIndex : packoffset(c5);
  float VAR_Speed : packoffset(c5.y);
  float VAR_Volume_Power : packoffset(c5.z);
  float VAR_Width_Top : packoffset(c5.w);
  float VAR_Width_Bottom : packoffset(c6);
  float VAR_Edge_Scale : packoffset(c6.y);
  float VAR_Edge_Gradation : packoffset(c6.z);
  float CAPCOM_MATERIAL_RESERVE : packoffset(c6.w);
}

SamplerState BilinearWrap_s : register(s0);
SamplerState AutomaticWrap_s : register(s1);
Texture2D<float> ReadonlyDepth : register(t0);
Texture2D<float4> DynamicTransparentHDR : register(t1);
Texture2D<float4> BaseAlphaMap : register(t2);
Texture2D<float4> NormalMap : register(t3);


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


void main(
  float4 v0 : SV_POSITION0,
  float4 v1 : INTERPOLATOR0,
  float4 v2 : INTERPOLATOR1,
  uint v3 : SV_IsFrontFace0,
  out float4 o0 : SV_TARGET0)
{
  float4 r0,r1,r2,r3,r4,r5;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);
  
  r0.xy = -screenInverseSize.yx * v0.yx + float2(1,1);
  r0.z = VAR_Edge_Scale * 0.550000012 + -0.100000001;
  r0.z = VAR_Edge_Gradation * -r0.z + r0.z;
  r0.xy = r0.xy + -r0.zz;
  r0.w = VAR_Edge_Scale * 0.550000012 + -r0.z;
  r1.xy = screenInverseSize.yx * v0.yx + -r0.zz;
  r0.z = 1 / r0.w;
  r0.xy = saturate(r0.xy * r0.zz);
  r0.zw = saturate(r1.xy * r0.zz);
  r1.xy = r0.xy * float2(-2,-2) + float2(3,3);
  r0.xy = r0.xy * r0.xy;
  r0.xy = r1.xy * r0.xy;
  r1.xy = r0.zw * float2(-2,-2) + float2(3,3);
  r0.zw = r0.zw * r0.zw;
  r0.zw = r1.xy * r0.zw;
  r0.xy = r0.zw * r0.xy;
  r0.x = r0.y * r0.x;
  r0.y = 9.99999975e-005 * screenSize.x;
  r0.y = r0.y / v0.w;
  r0.z = -1 + VAR_RefractiveIndex;
  r0.y = r0.z * r0.y;
  r0.z = r0.x * r0.y;
  r1.xy = float2(1,1) + -VAR_Speed;
  r1.zw = cmp(-abs(VAR_Speed) >= float2(0,0));
  r1.zw = r1.zw ? float2(1,1) : 0;
  r1.xy = r1.zw * r1.xy + VAR_Speed;
  r1.x = 600 / r1.x;
  r1.x = floor(r1.x);
  r1.x = userGlobalParams._m00 * r1.x;
  r1.x = frac(r1.x);
  r1.x = r1.z * -r1.x + r1.x;
  r2.x = v1.w;
  r2.y = v2.x;
  r2.zw = VAR_Normal_UV_Tilling.xy * r2.xy + r1.xx;
  r3.xy = VAR_UV_Tilling.xy * r2.xy + r1.xx;
  r2.xyz = NormalMap.Sample(BilinearWrap_s, r2.zw).xyz;
  r1.x = dot(v1.xyz, v1.xyz);
  r1.x = rsqrt(r1.x);
  r2.xyz = -v1.xyz * r1.xxx + r2.xyz;
  r4.xyz = v1.xyz * r1.xxx;
  r2.xyz = VAR_RefractiveIndex * r2.xyz + r4.xyz;
  
  //r2.x-=stereo.x*(r2.z+stereo.y);
  
  r4.x = dot(r2.xyz, transposeViewMat._m00_m01_m02);
  r4.y = dot(r2.xyz, transposeViewMat._m10_m11_m12);
  r4.z = dot(r2.xyz, transposeViewMat._m20_m21_m22);
  r1.x = dot(r4.xyz, r4.xyz);
  r1.x = rsqrt(r1.x);
  r2.xyz = r4.xyz * r1.xxx;
  r4.x = -transposeViewInvMat._m03;
  r4.y = -transposeViewInvMat._m13;
  r4.z = -transposeViewInvMat._m23;
  r4.xyz = v2.yzw + r4.xyz;
  r1.x = dot(r4.xyz, r4.xyz);
  r1.x = rsqrt(r1.x);
  r4.xyz = r4.xyz * r1.xxx;
  r5.z = dot(r4.xyz, transposeViewMat._m20_m21_m22);
  r5.x = dot(r4.xyz, transposeViewMat._m00_m01_m02);
  r5.y = dot(r4.xyz, transposeViewMat._m10_m11_m12);
  r1.x = dot(r5.xyz, r5.xyz);
  r1.x = rsqrt(r1.x);
  r4.xyz = r5.xyz * r1.xxx;
  r1.xz = r5.xy * r1.xx + -r2.xy;
  r0.x = dot(r2.xyz, r4.xyz);
  r0.yw = float2(1,-1);
  r1.xz = r0.yx * r1.xz;
  r0.xy = r1.xz * r0.xz;
  r1.xz = screenInverseSize.xy * v0.xy;
  r0.xy = r0.xy * r0.zw + r1.xz;
  r0.xyz = DynamicTransparentHDR.Sample(BilinearWrap_s, r0.xy).xyz;
  r2.xyz = viewProjMat._m10_m11_m13 * v2.zzz;
  r2.xyz = v2.yyy * viewProjMat._m00_m01_m03 + r2.xyz;
  r2.xyz = v2.www * viewProjMat._m20_m21_m23 + r2.xyz;
  r2.xyz = viewProjMat._m30_m31_m33 + r2.xyz;
  r1.xz = r2.xy / r2.zz;
  r1.xz = r1.xz * float2(0.5,-0.5) + float2(0.5,0.5);
  r2.xyz = DynamicTransparentHDR.Sample(BilinearWrap_s, r1.xz).xyz;
  r0.xyz = -r2.xyz + r0.xyz;
  r4.xy = (int2)v0.xy;
  r4.zw = float2(0,0);
  r0.w = ReadonlyDepth.Load(r4.xyz).x;
  r0.w = -r0.w * ZToLinear.y + ZToLinear.x;
  r0.w = ZToLinear.z / r0.w;
  r4.xyz = v2.yzw;
  r4.w = 1;
  r1.x = dot(r4.xyzw, transposeViewMat._m20_m21_m22_m23);
  r1.z = dot(r4.xyzw, transposeViewMat._m10_m11_m12_m13);
  r1.z = -v2.z + r1.z;
  r3.z = r1.z * 0.0199999996 + r3.y;
  r1.x = -VAR_Width_Bottom + r1.x;
  r0.w = r1.x + r0.w;
  r0.w = dot(r0.www, r0.www);
  r0.w = sqrt(r0.w);
  r0.w = r0.w / r1.y;
  r0.w = saturate(r1.w * -r0.w + r0.w);
  r0.w = max(9.99999997e-007, r0.w);
  r0.w = log2(r0.w);
  r0.w = VAR_Volume_Power * r0.w;
  r0.w = exp2(r0.w);
  r0.w = saturate(VAR_ColorParam.w * r0.w);
  r0.xyz = r0.www * r0.xyz + r2.xyz;
  r0.xyz = VAR_Back_Intensity * r0.xyz;
  r1.xy = NormalMap.Sample(AutomaticWrap_s, r3.xz).xy;
  r1.xy = r1.xy * float2(2,2) + float2(-1,-1);
  r1.z = 1 + -VAR_Flow_Speed;
  r1.w = cmp(-abs(VAR_Flow_Speed) >= 0);
  r1.w = r1.w ? 1.000000 : 0;
  r1.z = r1.w * r1.z + VAR_Flow_Speed;
  r1.z = 600 / r1.z;
  r1.z = floor(r1.z);
  r1.z = userGlobalParams._m00 * r1.z;
  r1.z = frac(r1.z);
  r1.z = r1.w * -r1.z + r1.z;
  r1.w = 0.5 + r1.z;
  r1.w = frac(r1.w);
  r1.w = VAR_FlowIntensity * r1.w;
  r2.xy = r1.xy * r1.ww + r3.xz;
  r2.xy = BaseAlphaMap.Sample(AutomaticWrap_s, r2.xy).xy;
  r1.w = VAR_FlowIntensity * r1.z;
  r1.z = r1.z * 2 + -1;
  r1.z = 1 + -abs(r1.z);
  r1.z = 1 + -r1.z;
  r1.xy = r1.xy * r1.ww + r3.xz;
  r1.xy = BaseAlphaMap.Sample(AutomaticWrap_s, r1.xy).xy;
  r2.xy = r2.xy + -r1.xy;
  r1.xy = r1.zz * r2.xy + r1.xy;
  r1.xyz = BaseAlphaMap.Sample(BilinearWrap_s, r1.xy).xyz;
  r2.xyz = VAR_LowColor.xyz + -VAR_ColorParam.xyz;
  r1.xyz = r1.xyz * r2.xyz + VAR_ColorParam.xyz;
  r1.xyz = max(float3(9.99999997e-007,9.99999997e-007,9.99999997e-007), r1.xyz);
  r1.xyz = log2(r1.xyz);
  r1.xyz = VAR_Volume_Power * r1.xyz;
  r1.xyz = exp2(r1.xyz);
  r1.xyz = min(float3(1,1,1), r1.xyz);
  r1.xyz = VAR_Base_Intensity * r1.xyz;
  r0.xyz = r1.xyz * r0.xyz;
  r0.xyz = VAR_ColorParam.www * r0.xyz;
  o0.xyz = r0.xyz * r0.www;
  o0.w = r0.w;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.15-re2_workaround on Mon Mar 11 20:26:29 2019
//
//
// Buffer Definitions:
//
// cbuffer SceneInfo
// {
//
//   row_major float4x4 viewProjMat;    // Offset:    0 Size:    64
//   row_major float3x4 transposeViewMat;// Offset:   64 Size:    48
//   row_major float3x4 transposeViewInvMat;// Offset:  112 Size:    48
//   float4 projElement[2];             // Offset:  160 Size:    32 [unused]
//   float4 projInvElements[2];         // Offset:  192 Size:    32 [unused]
//   row_major float4x4 viewProjInvMat; // Offset:  224 Size:    64 [unused]
//   row_major float4x4 prevViewProjMat;// Offset:  288 Size:    64 [unused]
//   float3 ZToLinear;                  // Offset:  352 Size:    12
//   float subdivisionLevel;            // Offset:  364 Size:     4 [unused]
//   float2 screenSize;                 // Offset:  368 Size:     8
//   float2 screenInverseSize;          // Offset:  376 Size:     8
//   float2 cullingHelper;              // Offset:  384 Size:     8 [unused]
//   float cameraNearPlane;             // Offset:  392 Size:     4 [unused]
//   float cameraFarPlane;              // Offset:  396 Size:     4 [unused]
//   float4 viewFrustum[6];             // Offset:  400 Size:    96 [unused]
//   float4 clipplane;                  // Offset:  496 Size:    16 [unused]
//
// }
//
// cbuffer EnvironmentInfo
// {
//
//   uint timeMillisecond;              // Offset:    0 Size:     4 [unused]
//   uint frameCount;                   // Offset:    4 Size:     4 [unused]
//   uint isOddFrame;                   // Offset:    8 Size:     4 [unused]
//   uint reserveEnvironmentInfo;       // Offset:   12 Size:     4 [unused]
//   row_major float4x4 userGlobalParams;// Offset:   16 Size:    64
//   float breakingPBRSpecularIntensity;// Offset:   80 Size:     4 [unused]
//   float breakingPBRIBLReflectanceBias;// Offset:   84 Size:     4 [unused]
//   float breakingPBRIBLIntensity;     // Offset:   88 Size:     4 [unused]
//   float breakingPBR_Reserved;        // Offset:   92 Size:     4 [unused]
//
// }
//
// cbuffer UserMaterial
// {
//
//   float4 VAR_ColorParam;             // Offset:    0 Size:    16
//   float4 VAR_LowColor;               // Offset:   16 Size:    16
//   float4 VAR_UV_Tilling;             // Offset:   32 Size:    16
//   float4 VAR_Normal_UV_Tilling;      // Offset:   48 Size:    16
//   float VAR_Base_Intensity;          // Offset:   64 Size:     4
//   float VAR_Back_Intensity;          // Offset:   68 Size:     4
//   float VAR_FlowIntensity;           // Offset:   72 Size:     4
//   float VAR_Flow_Speed;              // Offset:   76 Size:     4
//   float VAR_RefractiveIndex;         // Offset:   80 Size:     4
//   float VAR_Speed;                   // Offset:   84 Size:     4
//   float VAR_Volume_Power;            // Offset:   88 Size:     4
//   float VAR_Width_Top;               // Offset:   92 Size:     4
//   float VAR_Width_Bottom;            // Offset:   96 Size:     4
//   float VAR_Edge_Scale;              // Offset:  100 Size:     4
//   float VAR_Edge_Gradation;          // Offset:  104 Size:     4
//   float CAPCOM_MATERIAL_RESERVE;     // Offset:  108 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// BilinearWrap                      sampler      NA          NA    0        1
// AutomaticWrap                     sampler      NA          NA    1        1
// ReadonlyDepth                     texture   float          2d    0        1
// DynamicTransparentHDR             texture  float4          2d    1        1
// BaseAlphaMap                      texture  float4          2d    2        1
// NormalMap                         texture  float4          2d    3        1
// SceneInfo                         cbuffer      NA          NA    0        1
// EnvironmentInfo                   cbuffer      NA          NA    1        1
// UserMaterial                      cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy w
// INTERPOLATOR             0   xyzw        1     NONE   float   xyzw
// INTERPOLATOR             1   xyzw        2     NONE   float   xyzw
// SV_IsFrontFace           0   x           3    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[24], immediateIndexed
dcl_constantbuffer cb1[2], immediateIndexed
dcl_constantbuffer cb2[7], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, 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_input_ps_siv linear noperspective v0.xyw, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyzw
dcl_output o0.xyzw
dcl_temps 6
mad r0.xy, -cb0[23].wzww, v0.yxyy, l(1.000000, 1.000000, 0.000000, 0.000000)
mad r0.z, cb2[6].y, l(0.550000), l(-0.100000)
mad r0.z, cb2[6].z, -r0.z, r0.z
add r0.xy, -r0.zzzz, r0.xyxx
mad r0.w, cb2[6].y, l(0.550000), -r0.z
mad r1.xy, cb0[23].wzww, v0.yxyy, -r0.zzzz
div r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
mul_sat r0.xy, r0.zzzz, r0.xyxx
mul_sat r0.zw, r0.zzzz, r1.xxxy
mad r1.xy, r0.xyxx, l(-2.000000, -2.000000, 0.000000, 0.000000), l(3.000000, 3.000000, 0.000000, 0.000000)
mul r0.xy, r0.xyxx, r0.xyxx
mul r0.xy, r0.xyxx, r1.xyxx
mad r1.xy, r0.zwzz, l(-2.000000, -2.000000, 0.000000, 0.000000), l(3.000000, 3.000000, 0.000000, 0.000000)
mul r0.zw, r0.zzzw, r0.zzzw
mul r0.zw, r0.zzzw, r1.xxxy
mul r0.xy, r0.xyxx, r0.zwzz
mul r0.x, r0.x, r0.y
mul r0.y, cb0[23].x, l(0.000100)
div r0.y, r0.y, v0.w
add r0.z, cb2[5].x, l(-1.000000)
mul r0.y, r0.y, r0.z
mul r0.z, r0.y, r0.x
add r1.xy, -cb2[5].ywyy, l(1.000000, 1.000000, 0.000000, 0.000000)
ge r1.zw, -|cb2[5].yyyw|, l(0.000000, 0.000000, 0.000000, 0.000000)
and r1.zw, r1.zzzw, l(0, 0, 0x3f800000, 0x3f800000)
mad r1.xy, r1.zwzz, r1.xyxx, cb2[5].ywyy
div r1.x, l(600.000000), r1.x
round_ni r1.x, r1.x
mul r1.x, r1.x, cb1[1].x
frc r1.x, r1.x
mad r1.x, r1.z, -r1.x, r1.x
mov r2.x, v1.w
mov r2.y, v2.x
mad r2.zw, cb2[3].xxxy, r2.xxxy, r1.xxxx
mad r3.xy, cb2[2].xyxx, r2.xyxx, r1.xxxx
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r2.zwzz, t3.xyzw, s0
dp3 r1.x, v1.xyzx, v1.xyzx
rsq r1.x, r1.x
mad r2.xyz, -v1.xyzx, r1.xxxx, r2.xyzx
mul r4.xyz, r1.xxxx, v1.xyzx
mad r2.xyz, cb2[5].xxxx, r2.xyzx, r4.xyzx
dp3 r4.x, r2.xyzx, cb0[4].xyzx
dp3 r4.y, r2.xyzx, cb0[5].xyzx
dp3 r4.z, r2.xyzx, cb0[6].xyzx
dp3 r1.x, r4.xyzx, r4.xyzx
rsq r1.x, r1.x
mul r2.xyz, r1.xxxx, r4.xyzx
mov r4.x, -cb0[7].w
mov r4.y, -cb0[8].w
mov r4.z, -cb0[9].w
add r4.xyz, r4.xyzx, v2.yzwy
dp3 r1.x, r4.xyzx, r4.xyzx
rsq r1.x, r1.x
mul r4.xyz, r1.xxxx, r4.xyzx
dp3 r5.z, r4.xyzx, cb0[6].xyzx
dp3 r5.x, r4.xyzx, cb0[4].xyzx
dp3 r5.y, r4.xyzx, cb0[5].xyzx
dp3 r1.x, r5.xyzx, r5.xyzx
rsq r1.x, r1.x
mul r4.xyz, r1.xxxx, r5.xyzx
mad r1.xz, r5.xxyx, r1.xxxx, -r2.xxyx
dp3 r0.x, r2.xyzx, r4.xyzx
mov r0.yw, l(0,1.000000,0,-1.000000)
mul r1.xz, r1.xxzx, r0.yyxy
mul r0.xy, r0.xzxx, r1.xzxx
mul r1.xz, v0.xxyx, cb0[23].zzwz
mad r0.xy, r0.xyxx, r0.zwzz, r1.xzxx
sample_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t1.xyzw, s0
mul r2.xyz, v2.zzzz, cb0[1].xywx
mad r2.xyz, v2.yyyy, cb0[0].xywx, r2.xyzx
mad r2.xyz, v2.wwww, cb0[2].xywx, r2.xyzx
add r2.xyz, r2.xyzx, cb0[3].xywx
div r1.xz, r2.xxyx, r2.zzzz
mad r1.xz, r1.xxzx, l(0.500000, 0.000000, -0.500000, 0.000000), l(0.500000, 0.000000, 0.500000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r1.xzxx, t1.xyzw, s0
add r0.xyz, r0.xyzx, -r2.xyzx
ftoi r4.xy, v0.xyxx
mov r4.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r0.w, r4.xyzw, t0.yzwx
mad r0.w, -r0.w, cb0[22].y, cb0[22].x
div r0.w, cb0[22].z, r0.w
mov r4.xyz, v2.yzwy
mov r4.w, l(1.000000)
dp4 r1.x, r4.xyzw, cb0[6].xyzw
dp4 r1.z, r4.xyzw, cb0[5].xyzw
add r1.z, r1.z, -v2.z
mad r3.z, r1.z, l(0.020000), r3.y
add r1.x, r1.x, -cb2[6].x
add r0.w, r0.w, r1.x
dp3 r0.w, r0.wwww, r0.wwww
sqrt r0.w, r0.w
div r0.w, r0.w, r1.y
mad_sat r0.w, r1.w, -r0.w, r0.w
max r0.w, r0.w, l(0.000001)
log r0.w, r0.w
mul r0.w, r0.w, cb2[5].z
exp r0.w, r0.w
mul_sat r0.w, r0.w, cb2[0].w
mad r0.xyz, r0.wwww, r0.xyzx, r2.xyzx
mul r0.xyz, r0.xyzx, cb2[4].yyyy
sample_indexable(texture2d)(float,float,float,float) r1.xy, r3.xzxx, t3.xyzw, s1
mad r1.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
add r1.z, -cb2[4].w, l(1.000000)
ge r1.w, -|cb2[4].w|, l(0.000000)
and r1.w, r1.w, l(0x3f800000)
mad r1.z, r1.w, r1.z, cb2[4].w
div r1.z, l(600.000000), r1.z
round_ni r1.z, r1.z
mul r1.z, r1.z, cb1[1].x
frc r1.z, r1.z
mad r1.z, r1.w, -r1.z, r1.z
add r1.w, r1.z, l(0.500000)
frc r1.w, r1.w
mul r1.w, r1.w, cb2[4].z
mad r2.xy, r1.xyxx, r1.wwww, r3.xzxx
sample_indexable(texture2d)(float,float,float,float) r2.xy, r2.xyxx, t2.xyzw, s1
mul r1.w, r1.z, cb2[4].z
mad r1.z, r1.z, l(2.000000), l(-1.000000)
add r1.z, -|r1.z|, l(1.000000)
add r1.z, -r1.z, l(1.000000)
mad r1.xy, r1.xyxx, r1.wwww, r3.xzxx
sample_indexable(texture2d)(float,float,float,float) r1.xy, r1.xyxx, t2.xyzw, s1
add r2.xy, -r1.xyxx, r2.xyxx
mad r1.xy, r1.zzzz, r2.xyxx, r1.xyxx
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t2.xyzw, s0
add r2.xyz, -cb2[0].xyzx, cb2[1].xyzx
mad r1.xyz, r1.xyzx, r2.xyzx, cb2[0].xyzx
max r1.xyz, r1.xyzx, l(0.000001, 0.000001, 0.000001, 0.000000)
log r1.xyz, r1.xyzx
mul r1.xyz, r1.xyzx, cb2[5].zzzz
exp r1.xyz, r1.xyzx
min r1.xyz, r1.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r1.xyz, r1.xyzx, cb2[4].xxxx
mul r0.xyz, r0.xyzx, r1.xyzx
mul r0.xyz, r0.xyzx, cb2[0].wwww
mul o0.xyz, r0.wwww, r0.xyzx
mov o0.w, r0.w
ret
// Approximately 138 instruction slots used

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