//Ice reflections 2
// ---- Created with 3Dmigoto v0.6.164 on Tue Mar 24 15:11:46 2026
Texture3D<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 cb2 : register(b2)
{
  float4 cb2[7];
}

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

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

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



// 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,
  float4 v4 : TEXCOORD3,
  float4 v5 : TEXCOORD4,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

//float4 s = StereoParams.Load(0);
//float4 testeo = IniParams.Load(int2(90,0)); 
//float fov = rsqrt(cb13[17].x * cb13[17].x + cb13[18].x * cb13[18].x + cb13[19].x * cb13[19].x);





  r0.xyzw = t0.Sample(s1_s, v1.xy).xyzw;
  r0.xyz = cb0[4].xyz * r0.xyz;
  r1.xyzw = t1.Sample(s2_s, v1.zw).xyzw;
  r1.xyz = float3(4,4,4) * r1.xyz;
  
  
  
  r2.xyz = r1.xyz * r0.xyz;
  r0.w = dot(r2.xyz, float3(0.0396819152,0.45802179,0.00609653955));
  r1.w = 1 + -cb0[7].w;
  
 
  
  r0.xyz = -r0.xyz * r1.xyz + r0.www;
  r0.xyz = r1.www * r0.xyz + r2.xyz;
  r0.w = cmp(cb2[0].x == 1.000000);
  if (r0.w != 0) {
    r0.w = cmp(cb2[0].y == 1.000000);
	


	
    r1.xyz = cb2[2].xyz * v3.yyy;
    r1.xyz = cb2[1].xyz * v3.xxx + r1.xyz;
    r1.xyz = cb2[3].xyz * v3.zzz + r1.xyz;
    r1.xyz = cb2[4].xyz + r1.xyz;
	
	

	
    r1.xyz = r0.www ? r1.xyz : v3.xyz;
    r1.xyz = -cb2[6].xyz + r1.xyz;
    r1.yzw = cb2[5].xyz * r1.xyz;
    r0.w = r1.y * 0.25 + 0.75;
    r1.y = cb2[0].z * 0.5 + 0.75;
    r1.x = max(r1.y, r0.w);
	
		
	
    r1.xyzw = t2.Sample(s0_s, r1.xzw).xyzw;
  } else {
    r1.xyzw = float4(1,1,1,1);
  }
  r0.w = saturate(dot(r1.xyzw, cb1[46].xyzw));
  r1.xyz = cb0[2].xyz * r0.www;
  r0.w = dot(v2.xyz, cb1[0].xyz);
  r0.w = max(0, r0.w);
  r1.xyz = r1.xyz * r0.xyz;
  r0.xyz = v4.xyz * r0.xyz;
  r0.xyz = r1.xyz * r0.www + r0.xyz;
  r0.w = -cb0[7].y + v3.y;
  r0.w = saturate(r0.w / cb0[7].z);
  r1.xyz = cb0[6].xyz + -cb0[5].xyz;
  r1.xyz = cb0[7].xxx * r1.xyz + cb0[5].xyz;
  r0.xyz = -r1.xyz + r0.xyz;
  o0.xyz = r0.www * r0.xyz + r1.xyz;
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.164 on Tue Mar 24 15:11:46 2026
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyz         2     NONE   float   xyz
// TEXCOORD                 2   xyz         3     NONE   float   xyz
// TEXCOORD                 3   xyz         4     NONE   float   xyz
// TEXCOORD                 4   xyzw        5     NONE   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer CB0[8], immediateIndexed
dcl_constantbuffer CB1[47], immediateIndexed
dcl_constantbuffer CB2[7], 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_texture3d (float,float,float,float) t2
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyz
dcl_output o0.xyzw
dcl_temps 3
sample r0.xyzw, v1.xyxx, t0.xyzw, s1
mul r0.xyz, r0.xyzx, cb0[4].xyzx
sample r1.xyzw, v1.zwzz, t1.xyzw, s2
mul r1.xyz, r1.xyzx, l(4.000000, 4.000000, 4.000000, 0.000000)
mul r2.xyz, r0.xyzx, r1.xyzx
dp3 r0.w, r2.xyzx, l(0.0396819152, 0.458021790, 0.00609653955, 0.000000)
add r1.w, -cb0[7].w, l(1.000000)
mad r0.xyz, -r0.xyzx, r1.xyzx, r0.wwww
mad r0.xyz, r1.wwww, r0.xyzx, r2.xyzx
eq r0.w, cb2[0].x, l(1.000000)
if_nz r0.w
  eq r0.w, cb2[0].y, l(1.000000)
  mul r1.xyz, v3.yyyy, cb2[2].xyzx
  mad r1.xyz, cb2[1].xyzx, v3.xxxx, r1.xyzx
  mad r1.xyz, cb2[3].xyzx, v3.zzzz, r1.xyzx
  add r1.xyz, r1.xyzx, cb2[4].xyzx
  movc r1.xyz, r0.wwww, r1.xyzx, v3.xyzx
  add r1.xyz, r1.xyzx, -cb2[6].xyzx
  mul r1.yzw, r1.xxyz, cb2[5].xxyz
  mad r0.w, r1.y, l(0.250000), l(0.750000)
  mad r1.y, cb2[0].z, l(0.500000), l(0.750000)
  max r1.x, r0.w, r1.y
  sample r1.xyzw, r1.xzwx, t2.xyzw, s0
else
  mov r1.xyzw, l(1.000000,1.000000,1.000000,1.000000)
endif
dp4_sat r0.w, r1.xyzw, cb1[46].xyzw
mul r1.xyz, r0.wwww, cb0[2].xyzx
dp3 r0.w, v2.xyzx, cb1[0].xyzx
max r0.w, r0.w, l(0.000000)
mul r1.xyz, r0.xyzx, r1.xyzx
mul r0.xyz, r0.xyzx, v4.xyzx
mad r0.xyz, r1.xyzx, r0.wwww, r0.xyzx
add r0.w, v3.y, -cb0[7].y
div_sat r0.w, r0.w, cb0[7].z
add r1.xyz, -cb0[5].xyzx, cb0[6].xyzx
mad r1.xyz, cb0[7].xxxx, r1.xyzx, cb0[5].xyzx
add r0.xyz, r0.xyzx, -r1.xyzx
mad o0.xyz, r0.wwww, r0.xyzx, r1.xyzx
mov o0.w, l(1.000000)
ret
// Approximately 0 instruction slots used

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