//Esidisi fire with 2D part PS (final attack).
// ---- Created with 3Dmigoto v1.3.16 on Sun Sep 04 14:13:25 2022

SamplerState g_sampler0_s : register(s0);
SamplerState g_samplerScreen0_s : register(s1);
SamplerState g_samplerScreen1_s : register(s2);
Texture2D<float4> g_texture0 : register(t0);
Texture2D<float4> g_texture2 : register(t1);
Texture2D<float4> g_texture3 : register(t2);


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


void main(
  float4 v0 : SV_Position0,
  float4 v1 : TEXCOORD0,
  float4 v2 : TEXCOORD1,
  float3 v3 : TEXCOORD4,
  float4 v4 : COLOR0,
  float4 v5 : COLOR1,
  float4 v6 : TEXCOORD6,
  float4 v7 : TEXCOORD7,
  out float4 o0 : SV_Target0,
  out float4 o1 : SV_Target1)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  float4 iniparams4 = IniParams.Load(int2(4,0));
  
  r0.xyzw = g_texture0.Sample(g_sampler0_s, v2.xy).xyzw;
  r1.xyzw = v1.xyzw * r0.xyzw;
  r0.w = cmp(v4.x >= r1.w);
  if (r0.w != 0) discard;
  r2.xy = v6.xy * v0.xy + v6.zw;
  r2.z = 1 + -r2.y;
  
  if (iniparams4.x==2) {
    r2.x-=stereo.x*(1-stereo.y/v0.w)*8.0;
  } else {
    r2.x-=stereo.x*(1-stereo.y/v0.w)*0.5;
  }
  
  r2.xyzw = g_texture2.Sample(g_samplerScreen0_s, r2.xz).xyzw;
  r0.w = v3.y * r2.w;
  r0.xyz = -r0.xyz * v1.xyz + r2.xyz;
  r0.xyz = r0.www * r0.xyz + r1.xyz;
  r1.xy = v7.xy * v0.xy + v7.zw;
  r1.z = 1 + -r1.y;
  
  if (iniparams4.y==2) {
    r1.x-=stereo.x*(1-stereo.y/v0.w)*12.0;
  } else {
    r1.x-=stereo.x*(1-stereo.y/v0.w)*0.5;
  }
  
  r2.xyzw = g_texture3.Sample(g_samplerScreen1_s, r1.xz).xyzw;
  r0.w = v3.z * r2.w;
  r1.xyz = r2.xyz + -r0.xyz;
  r0.xyz = r0.www * r1.xyz + r0.xyz;
  r0.w = v4.y * r1.w;
  r0.xyz = -v5.xyz + r0.xyz;
  o0.xyz = v3.xxx * r0.xyz + v5.xyz;
  o0.w = r0.w;
  o1.xy = v4.wz;
  o1.z = 0;
  o1.w = r0.w;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Sun Sep 04 14:13:25 2022
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_sampler0                        sampler      NA          NA    0        1
// g_samplerScreen0                  sampler      NA          NA    1        1
// g_samplerScreen1                  sampler      NA          NA    2        1
// g_texture0                        texture  float4          2d    0        1
// g_texture2                        texture  float4          2d    1        1
// g_texture3                        texture  float4          2d    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xy          2     NONE   float   xy
// TEXCOORD                 4   xyz         3     NONE   float   xyz
// COLOR                    0   xyzw        4     NONE   float   xyzw
// COLOR                    1   xyzw        5     NONE   float   xyz
// TEXCOORD                 6   xyzw        6     NONE   float   xyzw
// TEXCOORD                 7   xyzw        7     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
//
ps_4_0
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, 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_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyzw
dcl_input_ps linear v5.xyz
dcl_input_ps linear v6.xyzw
dcl_input_ps linear v7.xyzw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 3
sample r0.xyzw, v2.xyxx, t0.xyzw, s0
mul r1.xyzw, r0.xyzw, v1.xyzw
ge r0.w, v4.x, r1.w
discard_nz r0.w
mad r2.xy, v6.xyxx, v0.xyxx, v6.zwzz
add r2.z, -r2.y, l(1.000000)
sample r2.xyzw, r2.xzxx, t1.xyzw, s1
mul r0.w, r2.w, v3.y
mad r0.xyz, -r0.xyzx, v1.xyzx, r2.xyzx
mad r0.xyz, r0.wwww, r0.xyzx, r1.xyzx
mad r1.xy, v7.xyxx, v0.xyxx, v7.zwzz
add r1.z, -r1.y, l(1.000000)
sample r2.xyzw, r1.xzxx, t2.xyzw, s2
mul r0.w, r2.w, v3.z
add r1.xyz, -r0.xyzx, r2.xyzx
mad r0.xyz, r0.wwww, r1.xyzx, r0.xyzx
mul r0.w, r1.w, v4.y
add r0.xyz, r0.xyzx, -v5.xyzx
mad o0.xyz, v3.xxxx, r0.xyzx, v5.xyzx
mov o0.w, r0.w
mov o1.xy, v4.wzww
mov o1.z, l(0)
mov o1.w, r0.w
ret
// Approximately 24 instruction slots used

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