// Black smoke (final cutscene)
//
// ---- Created with geo-11 v0.6.198 on Sun Nov  2 22:22:40 2025
Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb1 : register(b1)
{
  float4 cb1[7];
}

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




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


void main(
  float4 v0 : COLOR0,
  float4 v1 : TEXCOORD0,
  float4 v2 : TEXCOORD1,
  float4 v3 : TEXCOORD2,
  float4 v4 : TEXCOORD3,
  float4 v5 : TEXCOORD6,
  float3 v6 : TEXCOORD8,
  float4 v7 : SV_POSITION0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);

  r0.xyzw = t0.Sample(s0_s, v1.xy).xyzw;
  r0.xyzw = cb1[3].xyzw * r0.xyzw;
  r0.xyz = v0.xyz * cb1[5].xxx + r0.xyz;
  r1.xyz = abs(r0.xyz) + -r0.xyz;
  r1.xyz = cb1[5].yyy * r1.xyz + r0.xyz;
  r1.w = v0.w * r0.w;
  r0.xy = cmp(float2(0,0) < cb1[0].xy);
  r0.x = (int)r0.y | (int)r0.x;
  if (r0.x != 0) {

    //Haloing fix
    v5.x += stereo.x * (v5.w - stereo.y) * 0.5;

    r0.xyz = v5.xyz / v5.www;
    r2.xyzw = t1.Sample(s1_s, r0.xy).xyzw;
    r0.x = cb0[14].z * r2.x + cb0[14].w;
    r0.x = 1 / r0.x;
    r0.y = cb0[14].z * r0.z + cb0[14].w;
    r0.y = 1 / r0.y;
    r0.x = -cb1[0].x + r0.x;
    r0.x = r0.x + -r0.y;
    r0.x = saturate(cb1[0].y * r0.x);
  } else {
    r0.x = 1;
  }
  r0.y = 1;
  r0.xyzw = r1.xyzw * r0.yyyx;
  r1.x = v5.z / v5.w;
  r1.x = cb0[14].z * r1.x + cb0[14].w;
  r1.x = 1 / r1.x;
  r1.x = -cb1[1].x + r1.x;
  r1.x = saturate(cb1[1].y * r1.x);
  r0.w = r1.x * r0.w;
  o0.xyz = v2.www * r0.xyz;
  r0.x = cmp(cb1[6].w == 1.000000);
  o0.w = r0.x ? r0.w : 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.198 on Sun Nov  2 22:22:40 2025
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR                    0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
// TEXCOORD                 1   xyzw        2     NONE   float      w
// TEXCOORD                 2   xyz         3     NONE   float
// TEXCOORD                 3   xyz         4     NONE   float
// TEXCOORD                 6   xyzw        5     NONE   float   xyzw
// TEXCOORD                 8   xyz         6     NONE   float
// SV_POSITION              0   xyzw        7      POS   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer CB0[15], immediateIndexed
dcl_constantbuffer CB1[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_input_ps linear v0.xyzw
dcl_input_ps linear v1.xy
dcl_input_ps linear v2.w
dcl_input_ps linear v5.xyzw
dcl_output o0.xyzw
dcl_temps 3
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
mul r0.xyzw, r0.xyzw, cb1[3].xyzw
mad r0.xyz, v0.xyzx, cb1[5].xxxx, r0.xyzx
add r1.xyz, -r0.xyzx, |r0.xyzx|
mad r1.xyz, cb1[5].yyyy, r1.xyzx, r0.xyzx
mul r1.w, r0.w, v0.w
lt r0.xy, l(0.000000, 0.000000, 0.000000, 0.000000), cb1[0].xyxx
or r0.x, r0.y, r0.x
if_nz r0.x
  div r0.xyz, v5.xyzx, v5.wwww
  sample r2.xyzw, r0.xyxx, t1.xyzw, s1
  mad r0.x, cb0[14].z, r2.x, cb0[14].w
  div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
  mad r0.y, cb0[14].z, r0.z, cb0[14].w
  div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y
  add r0.x, r0.x, -cb1[0].x
  add r0.x, -r0.y, r0.x
  mul_sat r0.x, r0.x, cb1[0].y
else
  mov r0.x, l(1.000000)
endif
mov r0.y, l(1.000000)
mul r0.xyzw, r0.yyyx, r1.xyzw
div r1.x, v5.z, v5.w
mad r1.x, cb0[14].z, r1.x, cb0[14].w
div r1.x, l(1.000000, 1.000000, 1.000000, 1.000000), r1.x
add r1.x, r1.x, -cb1[1].x
mul_sat r1.x, r1.x, cb1[1].y
mul r0.w, r0.w, r1.x
mul o0.xyz, r0.xyzx, v2.wwww
eq r0.x, cb1[6].w, l(1.000000)
movc o0.w, r0.x, r0.w, l(1.000000)
ret
// Approximately 0 instruction slots used

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