// Water pool (Greenhouse cutscene)
//
// ---- Created with geo-11 v0.6.198 on Fri Oct 31 14:32:40 2025
Texture2D<float4> t2 : register(t2);

Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s2_s : register(s2);

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,
  uint v1 : CUSTOM_INSTANCE_ID0,
  float4 v2 : TEXCOORD0,
  float4 v3 : TEXCOORD1,
  out float4 o0 : SV_TARGET0)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);

  r0.xyz = cb0[62].xyw * v2.yyy;
  r0.xyz = cb0[61].xyw * v2.xxx + r0.xyz;
  r0.xyz = cb0[63].xyw * v2.zzz + r0.xyz;
  r0.xyz = cb0[64].xyw + r0.xyz;
  r0.y = cb0[12].x * r0.y;
  r1.xzw = float3(0.5,0.5,0.5) * r0.xzy;
  r0.xy = r1.xw + r1.zz;

  //Stereoize water in pool
  r0.x += stereo.x * (r0.z - stereo.y) * 0.5;

  r0.xy = r0.xy / r0.zz;
  r0.xyzw = t0.Sample(s0_s, r0.xy).xyzw;
  r0.x = cb0[14].z * r0.x + cb0[14].w;
  r0.x = 1 / r0.x;
  r0.y = cb0[54].z * v2.y;
  r0.y = cb0[53].z * v2.x + r0.y;
  r0.y = cb0[55].z * v2.z + r0.y;
  r0.y = cb0[56].z + r0.y;
  r0.x = r0.x + r0.y;
  r0.x = saturate(-0.100000001 + r0.x);
  r0.x = 1 + -r0.x;
  r1.xyzw = float4(-0.00999999978,-0.00999999978,0.00999999978,0.00999999978) * cb0[10].xxxx;
  r1.xyzw = v3.xyxy * float4(2.5,2.5,5,5) + r1.xyzw;
  r2.xyzw = t1.Sample(s1_s, r1.xy).xyzw;
  r1.xyzw = t2.Sample(s2_s, r1.zw).xyzw;
  r0.yzw = r2.xyz * r1.xyz;
  r0.xyz = r0.xxx * float3(0.5,0.5,0.5) + r0.yzw;
  r0.xyz = cmp(r0.xyz >= float3(0.300000012,0.300000012,0.300000012));
  r0.xyz = r0.xyz ? float3(1,1,1) : 0;
  r1.xyz = cb1[1].xyz + -cb1[0].xyz;
  o0.xyz = r0.xyz * r1.xyz + cb1[0].xyz;
  o0.w = cb1[2].y;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.198 on Fri Oct 31 14:32:40 2025
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// CUSTOM_INSTANCE_ID       0   x           1     NONE    uint
// TEXCOORD                 0   xyz         2     NONE   float   xyz
// TEXCOORD                 1   xyzw        3     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer CB0[65], immediateIndexed
dcl_constantbuffer CB1[3], immediateIndexed
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 linear v2.xyz
dcl_input_ps linear v3.xy
dcl_output o0.xyzw
dcl_temps 3
mul r0.xyz, v2.yyyy, cb0[62].xywx
mad r0.xyz, cb0[61].xywx, v2.xxxx, r0.xyzx
mad r0.xyz, cb0[63].xywx, v2.zzzz, r0.xyzx
add r0.xyz, r0.xyzx, cb0[64].xywx
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 r0.xyzw, r0.xyxx, t0.xyzw, s0
mad r0.x, cb0[14].z, r0.x, cb0[14].w
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
mul r0.y, v2.y, cb0[54].z
mad r0.y, cb0[53].z, v2.x, r0.y
mad r0.y, cb0[55].z, v2.z, r0.y
add r0.y, r0.y, cb0[56].z
add r0.x, r0.y, r0.x
add_sat r0.x, r0.x, l(-0.100000)
add r0.x, -r0.x, l(1.000000)
mul r1.xyzw, cb0[10].xxxx, l(-0.010000, -0.010000, 0.010000, 0.010000)
mad r1.xyzw, v3.xyxy, l(2.500000, 2.500000, 5.000000, 5.000000), r1.xyzw
sample r2.xyzw, r1.xyxx, t1.xyzw, s1
sample r1.xyzw, r1.zwzz, t2.xyzw, s2
mul r0.yzw, r1.xxyz, r2.xxyz
mad r0.xyz, r0.xxxx, l(0.500000, 0.500000, 0.500000, 0.000000), r0.yzwy
ge r0.xyz, r0.xyzx, l(0.300000, 0.300000, 0.300000, 0.000000)
and r0.xyz, r0.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
add r1.xyz, -cb1[0].xyzx, cb1[1].xyzx
mad o0.xyz, r0.xyzx, r1.xyzx, cb1[0].xyzx
mov o0.w, cb1[2].y
ret
// Approximately 0 instruction slots used

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