//reflections wet street
// ---- Created with 3Dmigoto v0.6.164 on Sun Aug 24 09:01:38 2025

cbuffer _Globals : register(b0)
{
  float2 d019_SrcTexture0SizeInv : packoffset(c64);
  float3 D270_WetRoadEnvMapAmountAndBlurriness : packoffset(c65);
}

cbuffer cb13 : register(b13)
{
  float4 cb13[100];
}


SamplerState S004_ReflectionTexture_sampler_s : register(s8);
Texture2D<float4> S004_ReflectionTexture : register(t8);


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


void main(
  float4 v0 : SV_Position0,
  float4 v1 : TEXCOORD0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = float4(0,0,0,-3);
  while (true) {
    r1.x = cmp((int)r0.w >= 4);
    if (r1.x != 0) break;
    r1.x = (int)r0.w;
    r1.x = D270_WetRoadEnvMapAmountAndBlurriness.z * r1.x;
    r1.xy = d019_SrcTexture0SizeInv.xy * r1.xx;
	
    r1.xy = -r1.xy * float2(0,1) + v1.xy;
    r1.xyz = S004_ReflectionTexture.Sample(S004_ReflectionTexture_sampler_s, r1.xy).xyz;
    r0.xyz = r1.xyz + r0.xyz;
    r0.w = (int)r0.w + 1;
  }
  o0.xyz = float3(0.142857149,0.142857149,0.142857149) * r0.xyz;
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.164 on Sun Aug 24 09:01:38 2025
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float2 d019_SrcTexture0SizeInv;    // Offset: 1024 Size:     8
//   float3 D270_WetRoadEnvMapAmountAndBlurriness;// Offset: 1040 Size:    12
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// S004_ReflectionTexture_sampler    sampler      NA          NA    8        1
// S004_ReflectionTexture            texture  float4          2d    8        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// TEXCOORD                 0   xyzw        1     NONE   float   xy
//
//
// 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[66], immediateIndexed
dcl_sampler s8, mode_default
dcl_resource_texture2d (float,float,float,float) t8
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 2
mov r0.xyzw, l(0,0,0,-3)
loop
  ige r1.x, r0.w, l(4)
  breakc_nz r1.x
  itof r1.x, r0.w
  mul r1.x, r1.x, cb0[65].z
  mul r1.xy, r1.xxxx, cb0[64].xyxx
  mad r1.xy, -r1.xyxx, l(0.000000, 1.000000, 0.000000, 0.000000), v1.xyxx
  sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t8.xyzw, s8
  add r0.xyz, r0.xyzx, r1.xyzx
  iadd r0.w, r0.w, l(1)
endloop
mul o0.xyz, r0.xyzx, l(0.142857149, 0.142857149, 0.142857149, 0.000000)
mov o0.w, l(1.000000)
ret
// Approximately 15 instruction slots used

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