// Dust clouds while running PS
//
// ---- Created with 3Dmigoto v0.6.164 on Tue Oct 28 02:33:16 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[3];
}

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




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


void main(
  float4 v0 : SV_POSITION0,
  float2 v1 : TEXCOORD0,
  float4 v2 : COLOR0,
  float3 v3 : TEXCOORD3,
  nointerpolation float4 v4 : NORMAL0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);

  r0.xyzw = cb0[62].xyww * v3.yyyy;
  r0.xyzw = cb0[61].xyww * v3.xxxx + r0.xyzw;
  r0.xyzw = cb0[63].xyww * v3.zzzz + r0.xyzw;
  r0.xyzw = cb0[64].xyww + r0.xyzw;
  r0.y = cb0[12].x * r0.y;
  r1.xzw = float3(0.5,0.5,0.5) * r0.xzy;
  r0.xy = r1.xw + r1.zz;

  //Haloing fix
  r0.x += stereo.x * (r0.z - stereo.y) * 0.5;

  r0.xy = r0.xy / r0.zz;
  r0.x = t1.Sample(s1_s, r0.xy).x;
  r0.x = cb0[14].x * r0.x + cb0[14].y;
  r0.x = 1 / r0.x;
  r0.x = r0.x * cb0[12].z + -r0.z;
  r0.y = saturate(r0.w * cb0[47].z + cb0[47].w);
  r0.y = 1 + -r0.y;
  r0.x = saturate(cb1[2].z * r0.x);
  r1.xyz = -cb0[11].xyz + v3.xyz;
  r0.z = dot(r1.xyz, r1.xyz);
  r0.z = sqrt(r0.z);
  r0.z = -cb1[2].y + r0.z;
  r0.w = cb1[2].x + -cb1[2].y;
  r0.z = saturate(r0.z / r0.w);
  r0.w = 1 + -v4.w;
  r1.xyzw = t0.Sample(s0_s, v1.xy).xyzw;
  r0.w = saturate(r1.w + -r0.w);
  r0.z = r0.w * r0.z;
  r0.z = cmp(r0.z >= cb1[1].z);
  r0.z = r0.z ? 1.000000 : 0;
  o0.w = r0.x * r0.z;
  r0.xzw = v4.xyz * r1.xyz;
  r1.xyz = -r1.xyz * v4.xyz + cb0[48].xyz;
  r0.xyz = r0.yyy * r1.xyz + r0.xzw;
  r0.xyz = -cb0[48].xyz + r0.xyz;
  r0.w = v0.z * v0.w;
  r0.w = r0.w / cb0[12].y;
  r0.w = 1 + -r0.w;
  r0.w = cb0[12].z * r0.w;
  r0.w = max(0, r0.w);
  r0.w = saturate(r0.w * cb0[47].z + cb0[47].w);
  o0.xyz = r0.www * r0.xyz + cb0[48].xyz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.164 on Tue Oct 28 02:33:16 2025
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float     zw
// TEXCOORD                 0   xy          1     NONE   float   xy
// COLOR                    0   xyzw        2     NONE   float
// TEXCOORD                 3   xyz         3     NONE   float   xyz
// NORMAL                   0   xyzw        4     NONE   float   xyzw
//
//
// 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[65], immediateIndexed
dcl_constantbuffer CB1[3], 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_siv linear noperspective v0.zw, position
dcl_input_ps linear v1.xy
dcl_input_ps linear v3.xyz
dcl_input_ps constant v4.xyzw
dcl_output o0.xyzw
dcl_temps 2
mul r0.xyzw, v3.yyyy, cb0[62].xyww
mad r0.xyzw, cb0[61].xyww, v3.xxxx, r0.xyzw
mad r0.xyzw, cb0[63].xyww, v3.zzzz, r0.xyzw
add r0.xyzw, r0.xyzw, cb0[64].xyww
mul r0.y, r0.y, cb0[12].x
mul r1.xzw, r0.xxzy, l(0.500000, 0.000000, 0.500000, 0.500000)
add r0.xy, r1.zzzz, r1.xwxx
div r0.xy, r0.xyxx, r0.zzzz
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t1.xyzw, s1
mad r0.x, cb0[14].x, r0.x, cb0[14].y
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
mad r0.x, r0.x, cb0[12].z, -r0.z
mad_sat r0.y, r0.w, cb0[47].z, cb0[47].w
add r0.y, -r0.y, l(1.000000)
mul_sat r0.x, r0.x, cb1[2].z
add r1.xyz, v3.xyzx, -cb0[11].xyzx
dp3 r0.z, r1.xyzx, r1.xyzx
sqrt r0.z, r0.z
add r0.z, r0.z, -cb1[2].y
add r0.w, -cb1[2].y, cb1[2].x
div_sat r0.z, r0.z, r0.w
add r0.w, -v4.w, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, v1.xyxx, t0.xyzw, s0
add_sat r0.w, -r0.w, r1.w
mul r0.z, r0.z, r0.w
ge r0.z, r0.z, cb1[1].z
and r0.z, r0.z, l(0x3f800000)
mul o0.w, r0.z, r0.x
mul r0.xzw, r1.xxyz, v4.xxyz
mad r1.xyz, -r1.xyzx, v4.xyzx, cb0[48].xyzx
mad r0.xyz, r0.yyyy, r1.xyzx, r0.xzwx
add r0.xyz, r0.xyzx, -cb0[48].xyzx
mul r0.w, v0.w, v0.z
div r0.w, r0.w, cb0[12].y
add r0.w, -r0.w, l(1.000000)
mul r0.w, r0.w, cb0[12].z
max r0.w, r0.w, l(0.000000)
mad_sat r0.w, r0.w, cb0[47].z, cb0[47].w
mad o0.xyz, r0.wwww, r0.xyzx, cb0[48].xyzx
ret
// Approximately 0 instruction slots used

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