// ---- Created with 3Dmigoto v1.3.16 on Mon Jun 24 15:08:03 2024
Texture2D<float4> t6 : register(t6);

Texture2D<float4> t5 : register(t5);

Texture3D<float4> t4 : register(t4);

Texture3D<float4> t3 : register(t3);

Texture2D<float4> t2 : register(t2);

Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s3_s : register(s3);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

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




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


void main(
  float4 v0 : SV_POSITION0,
  float4 v1 : COLOR0,
  float4 v2 : TEXCOORD0,
  float4 v3 : TEXCOORD1,
  float4 v4 : TEXCOORD2,
  float4 v5 : TEXCOORD6,
  float4 v6 : TEXCOORD7,
  float4 v7 : TEXCOORD5,
  float4 v8 : TEXCOORD8,
  float4 v9 : TEXCOORD9,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = t0.Sample(s2_s, v5.xy).xyzw;
  r1.x = cmp(cb0[103].y == 0.000000);
  if (r1.x != 0) {
    r1.x = r0.x;
  } else {
    r1.yzw = cmp(cb0[103].yyy == float3(1,2,3));
    r1.w = r1.w ? r0.w : 0;
    r1.z = r1.z ? r0.z : r1.w;
    r1.x = r1.y ? r0.y : r1.z;
  }
  r1.x = saturate(cb0[103].x * r1.x);
  r1.y = cmp(cb0[100].z == 1.000000);
  if (r1.y != 0) {
    r1.yzw = v4.xyz + -v3.xyz;
    r1.yzw = r1.xxx * r1.yzw + v3.xyz;
  } else {
    r2.xyz = cb0[102].xyz + -cb0[101].xyz;
    r1.yzw = r1.xxx * r2.xyz + cb0[101].xyz;
  }
  r2.xy = cmp(cb0[116].zw == float2(0,0));
  if (r2.x == 0) {
    r3.xyzw = cmp(cb0[116].zzzz == float4(1,2,3,4));
    r1.x = r3.w ? 1.000000 : 0;
    r0.w = r3.z ? r0.w : r1.x;
    r0.z = r3.y ? r0.z : r0.w;
    r0.x = r3.x ? r0.y : r0.z;
  }
  r0.y = cmp(cb0[117].x == 1.000000);
  if (r0.y != 0) {
    r0.yz = v6.xy + v2.zw;
  } else {
    r0.yz = v6.xy;
  }
  r3.xyzw = t1.Sample(s3_s, r0.yz).xyzw;
  if (r2.y == 0) {
    r0.yzw = cmp(cb0[116].www == float3(1,2,3));
    r0.w = r0.w ? r3.w : 0;
    r0.z = r0.z ? r3.z : r0.w;
    r3.x = r0.y ? r3.y : r0.z;
  }
  r0.yzw = cb0[111].xyz * v1.xyz;
  r1.x = -v1.w * cb0[111].w + 1;
  r0.x = r0.x * r3.x + -r1.x;
  r0.x = saturate(cb0[119].y * r0.x);
  r0.x = saturate(cb0[116].y * r0.x);
  r0.yzw = r1.yzw * r0.yzw;
  r0.yzw = cb0[100].yyy * r0.yzw;
  r0.yzw = cb0[112].xyz * r0.yzw;
  r1.x = cmp(0 < cb0[62].x);
  if (r1.x != 0) {
    r1.x = t2.Load(float4(0,0,0,0)).y;
    r1.x = -1 + r1.x;
    r1.x = cb0[62].x * r1.x + 1;
    r0.yzw = r1.xxx * r0.yzw;
  }
  r1.x = cmp(0 != cb0[100].x);
  r1.y = cmp(0 != cb0[63].x);
  r1.x = r1.y ? r1.x : 0;
  if (r1.x != 0) {
    r1.xyz = max(float3(9.99999975e-05,9.99999975e-05,9.99999975e-05), r0.yzw);
    r2.xyz = cb0[91].xyz * v9.yyy;
    r2.xyz = cb0[90].xyz * v9.xxx + r2.xyz;
    r2.xyz = cb0[92].xyz * v9.zzz + r2.xyz;
    r2.xyz = cb0[93].xyz + r2.xyz;
    r3.xy = v9.xz * cb0[98].xy + cb0[98].zw;
    r1.w = t3.Sample(s0_s, r2.xyz).x;
    r2.x = t5.Sample(s1_s, r3.xy).x;
    r1.w = saturate(r1.w * cb0[81].z + cb0[81].w);
    r2.yzw = cb0[80].xyz + -v9.xyz;
    r2.y = dot(r2.yzw, r2.yzw);
    r2.y = sqrt(r2.y);
    r2.y = saturate(r2.y * cb0[81].x + cb0[81].y);
    r1.w = r2.y * r1.w;
    r1.w = r1.w * r2.x;
    r2.x = dot(r1.xyz, float3(0.212672904,0.715152204,0.0721750036));
    r2.yzw = -r2.xxx + r1.xyz;
    r3.xyz = cb0[84].xyz * r2.yzw + r2.xxx;
    r3.xyz = max(float3(0,0,0), r3.xyz);
    r3.xyz = log2(r3.xyz);
    r4.x = cb0[84].w * r3.x;
    r4.y = cb0[85].w * r3.y;
    r4.z = cb0[86].w * r3.z;
    r3.xyz = exp2(r4.xyz);
    r3.xyz = r3.xyz * cb0[85].xyz + cb0[86].xyz;
    r3.w = cmp(1 < asint(cb0[79].x));
    if (r3.w != 0) {
      r3.w = cmp(r1.w < 0.00196078443);
      if (r3.w != 0) {
        r4.xyz = cb0[95].xyz * v9.yyy;
        r4.xyz = cb0[94].xyz * v9.xxx + r4.xyz;
        r4.xyz = cb0[96].xyz * v9.zzz + r4.xyz;
        r4.xyz = cb0[97].xyz + r4.xyz;
        r5.xy = v9.xz * cb0[99].xy + cb0[99].zw;
        r3.w = t4.Sample(s0_s, r4.xyz).x;
        r4.x = t6.Sample(s1_s, r5.xy).x;
        r3.w = saturate(r3.w * cb0[83].z + cb0[83].w);
        r4.yzw = cb0[82].xyz + -v9.xyz;
        r4.y = dot(r4.yzw, r4.yzw);
        r4.y = sqrt(r4.y);
        r4.y = saturate(r4.y * cb0[83].x + cb0[83].y);
        r3.w = r4.y * r3.w;
        r1.w = r3.w * r4.x;
        r2.xyz = cb0[87].xyz * r2.yzw + r2.xxx;
        r2.xyz = max(float3(0,0,0), r2.xyz);
        r2.xyz = log2(r2.xyz);
        r4.x = cb0[87].w * r2.x;
        r4.y = cb0[88].w * r2.y;
        r4.z = cb0[89].w * r2.z;
        r2.xyz = exp2(r4.xyz);
        r3.xyz = r2.xyz * cb0[88].xyz + cb0[89].xyz;
      }
    }
    r2.xyz = r3.xyz + -r1.xyz;
    o0.xyz = r1.www * r2.xyz + r1.xyz;
  } else {
    o0.xyz = r0.yzw;
  }
  r0.x = cb0[112].w * r0.x;
  o0.w = cb0[121].x * r0.x;
  o0.x = 5;
  o0.y = 0.616;
  o0.z = 0.361;//普通刀光，开大外层刀光
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Mon Jun 24 15:08:03 2024
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xyzw        2     NONE   float     zw
// TEXCOORD                 1   xyzw        3     NONE   float   xyz
// TEXCOORD                 2   xyzw        4     NONE   float   xyz
// TEXCOORD                 6   xyzw        5     NONE   float   xy
// TEXCOORD                 7   xyzw        6     NONE   float   xy
// TEXCOORD                 5   xyzw        7     NONE   float
// TEXCOORD                 8   xyzw        8     NONE   float
// TEXCOORD                 9   xyzw        9     NONE   float   xyz
//
//
// 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[122], 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_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture3d (float,float,float,float) t3
dcl_resource_texture3d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.zw
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyz
dcl_input_ps linear v5.xy
dcl_input_ps linear v6.xy
dcl_input_ps linear v9.xyz
dcl_output o0.xyzw
dcl_temps 6
sample_indexable(texture2d)(float,float,float,float) r0.xyzw, v5.xyxx, t0.xyzw, s2
eq r1.x, cb0[103].y, l(0.000000)
if_nz r1.x
  mov r1.x, r0.x
else
  eq r1.yzw, cb0[103].yyyy, l(0.000000, 1.000000, 2.000000, 3.000000)
  and r1.w, r0.w, r1.w
  movc r1.z, r1.z, r0.z, r1.w
  movc r1.x, r1.y, r0.y, r1.z
endif
mul_sat r1.x, r1.x, cb0[103].x
eq r1.y, cb0[100].z, l(1.000000)
if_nz r1.y
  add r1.yzw, -v3.xxyz, v4.xxyz
  mad r1.yzw, r1.xxxx, r1.yyzw, v3.xxyz
else
  add r2.xyz, -cb0[101].xyzx, cb0[102].xyzx
  mad r1.yzw, r1.xxxx, r2.xxyz, cb0[101].xxyz
endif
eq r2.xy, cb0[116].zwzz, l(0.000000, 0.000000, 0.000000, 0.000000)
if_z r2.x
  eq r3.xyzw, cb0[116].zzzz, l(1.000000, 2.000000, 3.000000, 4.000000)
  and r1.x, r3.w, l(0x3f800000)
  movc r0.w, r3.z, r0.w, r1.x
  movc r0.z, r3.y, r0.z, r0.w
  movc r0.x, r3.x, r0.y, r0.z
endif
eq r0.y, cb0[117].x, l(1.000000)
if_nz r0.y
  add r0.yz, v2.zzwz, v6.xxyx
else
  mov r0.yz, v6.xxyx
endif
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r0.yzyy, t1.xyzw, s3
if_z r2.y
  eq r0.yzw, cb0[116].wwww, l(0.000000, 1.000000, 2.000000, 3.000000)
  and r0.w, r3.w, r0.w
  movc r0.z, r0.z, r3.z, r0.w
  movc r3.x, r0.y, r3.y, r0.z
endif
mul r0.yzw, v1.xxyz, cb0[111].xxyz
mad r1.x, -v1.w, cb0[111].w, l(1.000000)
mad r0.x, r0.x, r3.x, -r1.x
mul_sat r0.x, r0.x, cb0[119].y
mul_sat r0.x, r0.x, cb0[116].y
mul r0.yzw, r0.yyzw, r1.yyzw
mul r0.yzw, r0.yyzw, cb0[100].yyyy
mul r0.yzw, r0.yyzw, cb0[112].xxyz
lt r1.x, l(0.000000), cb0[62].x
if_nz r1.x
  ld_indexable(texture2d)(float,float,float,float) r1.x, l(0, 0, 0, 0), t2.yxzw
  add r1.x, r1.x, l(-1.000000)
  mad r1.x, cb0[62].x, r1.x, l(1.000000)
  mul r0.yzw, r0.yyzw, r1.xxxx
endif
ne r1.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[100].x
ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[63].x
and r1.x, r1.y, r1.x
if_nz r1.x
  max r1.xyz, r0.yzwy, l(0.000100, 0.000100, 0.000100, 0.000000)
  mul r2.xyz, v9.yyyy, cb0[91].xyzx
  mad r2.xyz, cb0[90].xyzx, v9.xxxx, r2.xyzx
  mad r2.xyz, cb0[92].xyzx, v9.zzzz, r2.xyzx
  add r2.xyz, r2.xyzx, cb0[93].xyzx
  mad r3.xy, v9.xzxx, cb0[98].xyxx, cb0[98].zwzz
  sample_indexable(texture3d)(float,float,float,float) r1.w, r2.xyzx, t3.yzwx, s0
  sample_indexable(texture2d)(float,float,float,float) r2.x, r3.xyxx, t5.xyzw, s1
  mad_sat r1.w, r1.w, cb0[81].z, cb0[81].w
  add r2.yzw, -v9.xxyz, cb0[80].xxyz
  dp3 r2.y, r2.yzwy, r2.yzwy
  sqrt r2.y, r2.y
  mad_sat r2.y, r2.y, cb0[81].x, cb0[81].y
  mul r1.w, r1.w, r2.y
  mul r1.w, r2.x, r1.w
  dp3 r2.x, r1.xyzx, l(0.212672904, 0.715152204, 0.072175, 0.000000)
  add r2.yzw, r1.xxyz, -r2.xxxx
  mad r3.xyz, cb0[84].xyzx, r2.yzwy, r2.xxxx
  max r3.xyz, r3.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  log r3.xyz, r3.xyzx
  mul r4.x, r3.x, cb0[84].w
  mul r4.y, r3.y, cb0[85].w
  mul r4.z, r3.z, cb0[86].w
  exp r3.xyz, r4.xyzx
  mad r3.xyz, r3.xyzx, cb0[85].xyzx, cb0[86].xyzx
  ilt r3.w, l(1), cb0[79].x
  if_nz r3.w
    lt r3.w, r1.w, l(0.00196078443)
    if_nz r3.w
      mul r4.xyz, v9.yyyy, cb0[95].xyzx
      mad r4.xyz, cb0[94].xyzx, v9.xxxx, r4.xyzx
      mad r4.xyz, cb0[96].xyzx, v9.zzzz, r4.xyzx
      add r4.xyz, r4.xyzx, cb0[97].xyzx
      mad r5.xy, v9.xzxx, cb0[99].xyxx, cb0[99].zwzz
      sample_indexable(texture3d)(float,float,float,float) r3.w, r4.xyzx, t4.yzwx, s0
      sample_indexable(texture2d)(float,float,float,float) r4.x, r5.xyxx, t6.xyzw, s1
      mad_sat r3.w, r3.w, cb0[83].z, cb0[83].w
      add r4.yzw, -v9.xxyz, cb0[82].xxyz
      dp3 r4.y, r4.yzwy, r4.yzwy
      sqrt r4.y, r4.y
      mad_sat r4.y, r4.y, cb0[83].x, cb0[83].y
      mul r3.w, r3.w, r4.y
      mul r1.w, r4.x, r3.w
      mad r2.xyz, cb0[87].xyzx, r2.yzwy, r2.xxxx
      max r2.xyz, r2.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
      log r2.xyz, r2.xyzx
      mul r4.x, r2.x, cb0[87].w
      mul r4.y, r2.y, cb0[88].w
      mul r4.z, r2.z, cb0[89].w
      exp r2.xyz, r4.xyzx
      mad r3.xyz, r2.xyzx, cb0[88].xyzx, cb0[89].xyzx
    endif
  endif
  add r2.xyz, -r1.xyzx, r3.xyzx
  mad o0.xyz, r1.wwww, r2.xyzx, r1.xyzx
else
  mov o0.xyz, r0.yzwy
endif
mul r0.x, r0.x, cb0[112].w
mul o0.w, r0.x, cb0[121].x
ret
// Approximately 0 instruction slots used

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