//MGS2 camouflage PS 1.
// ---- Created with 3Dmigoto v0.6.181 on Sat Nov 11 14:50:01 2023

SamplerState sTextureSampler_s : register(s0);
Texture2D<float4> tTextureSampler : register(t0);


// 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,
  float4 v3 : TEXCOORD2,
  out float4 o0 : SV_TARGET0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  
  v1.x+=stereo.x*(1-stereo.y/v0.w)*0.5;
  
  r0.xyz = tTextureSampler.Sample(sTextureSampler_s, v1.xy).xyz;
  r1.xyz = v2.xyz * r0.xyz;
  r0.xyz = -r0.xyz * v2.xyz + v3.xyz;
  o0.xyz = v3.www * r0.xyz + r1.xyz;
  o0.w = v2.w;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v0.6.181 on Sat Nov 11 14:50:01 2023
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sTextureSampler                   sampler      NA          NA    0        1
// tTextureSampler                   texture  float4          2d    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// TEXCOORD                 0   xy          1     NONE   float   xy
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     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_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v3.xyzw
dcl_output o0.xyzw
dcl_temps 2
sample_indexable(texture2d)(float,float,float,float) r0.xyz, v1.xyxx, t0.xyzw, s0
mul r1.xyz, r0.xyzx, v2.xyzx
mad r0.xyz, -r0.xyzx, v2.xyzx, v3.xyzx
mad o0.xyz, v3.wwww, r0.xyzx, r1.xyzx
mov o0.w, v2.w
ret
// Approximately 6 instruction slots used

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