//speculars fixed in PS
// ---- Created with 3Dmigoto v0.6.164 on Sun Nov  2 16:38:32 2025
cbuffer cb4 : register(b4)
{
  float4 cb4[4];
}

cbuffer cb3 : register(b3)
{
  float4 cb3[14];
}

cbuffer cb2 : register(b2)
{
  float4 cb2[15];
}

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

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

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


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


void main(
  float3 v0 : POSITION0,
  float3 v1 : NORMAL0,
  float4 v2 : TANGENT0,
  float4 v3 : TEXCOORD0,
  float4 v4 : TEXCOORD1,
  uint v5 : SV_InstanceID0,
  out float4 o0 : SV_POSITION0,
  out uint o1 : CUSTOM_INSTANCE_ID0,
  out float4 o2 : TEXCOORD0,
  out float4 o3 : TEXCOORD1,
  out float4 o4 : TEXCOORD2,
  out float4 o5 : TEXCOORD3,
  out float4 o6 : TEXCOORD4,
  out float4 o7 : TEXCOORD5,
  out float4 o8 : TEXCOORD6,
  out float4 o9 : TEXCOORD7,
  out float4 o10 : TEXCOORD8,
  out float4 o11 : TEXCOORD9)
{
// Needs manual fix for instruction:
// unknown dcl_: dcl_input_sgv v5.x, instance_id
  float4 r0,r1,r2,r3,r4,r7;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 s = StereoParams.Load(0);
  float4 testeo = IniParams.Load(int2(90,0));  
  float fov = rsqrt(cb13[61].x * cb13[61].x + cb13[62].x * cb13[62].x + cb13[63].x * cb13[63].x);

  r0.x = (int)v5.x + asint(cb1[0].x);
  r0.y = (uint)r0.x << 3;
  r0.x = (int)r0.x * 7;
  r1.xyz = cb2[r0.y+1].xyz * v0.yyy;
  r1.xyz = cb2[r0.y+0].xyz * v0.xxx + r1.xyz;
  r1.xyz = cb2[r0.y+2].xyz * v0.zzz + r1.xyz;
  r1.xyz = cb2[r0.y+3].xyz + r1.xyz;
  r2.xyzw = cb0[62].xyzw * r1.yyyy;
  r2.xyzw = cb0[61].xyzw * r1.xxxx + r2.xyzw;
  r2.xyzw = cb0[63].xyzw * r1.zzzz + r2.xyzw;
  r2.xyzw = cb0[64].xyzw + r2.xyzw;
  o0.xyzw = r2.xyzw;
  r0.z = r2.z / cb0[12].y;
  r0.z = 1 + -r0.z;
  r0.z = cb0[12].z * r0.z;
  r0.z = max(0, r0.z);
  o10.x = saturate(r0.z * cb0[47].z + cb0[47].w);
  o1.x = v5.x;
  o2.xyz = r1.xyz;
  r2.x = dot(v1.xyz, cb2[r0.y+4].xyz);
  r2.y = dot(v1.xyz, cb2[r0.y+5].xyz);
  r2.z = dot(v1.xyz, cb2[r0.y+6].xyz);
  r0.z = dot(r2.xyz, r2.xyz);
  r0.z = max(1.17549435e-38, r0.z);
  r0.z = rsqrt(r0.z);
  r2.xyz = r2.xyz * r0.zzz;
  o3.xyz = r2.xyz;
  r3.xyz = cb2[r0.y+1].xyz * v2.yyy;
  r3.xyz = cb2[r0.y+0].xyz * v2.xxx + r3.xyz;
  r0.yzw = cb2[r0.y+2].xyz * v2.zzz + r3.xyz;
  r1.w = dot(r0.yzw, r0.yzw);
  r1.w = max(1.17549435e-38, r1.w);
  r1.w = rsqrt(r1.w);
  o4.xyz = r1.www * r0.yzw;
  o4.w = v2.w;
  o5.xyzw = v3.xyzw;
  o6.xyzw = v4.xyzw;
  o7.xyz = cb0[11].xyz + -r1.xyz;

  
  
o7.x += s.x *  s.y * cb13[57].x / fov ;
//o7.y += s.x *  s.y * cb13[58].x / fov ;
o7.z += s.x *  s.y * cb13[59].x / fov ;


  
  
  o8.xy = float2(0,0);
  r0.y = r2.y * r2.y;
  r0.y = r2.x * r2.x + -r0.y;
  r3.xyzw = r2.xyzz * r2.yzzx;
  r4.x = dot(cb3[r0.x+3].xyzw, r3.xyzw);
  r4.y = dot(cb3[r0.x+4].xyzw, r3.xyzw);
  r4.z = dot(cb3[r0.x+5].xyzw, r3.xyzw);
  r0.yzw = cb3[r0.x+6].xyz * r0.yyy + r4.xyz;
  r2.w = 1;
  r3.x = dot(cb3[r0.x+0].xyzw, r2.xyzw);
  r3.y = dot(cb3[r0.x+1].xyzw, r2.xyzw);
  r3.z = dot(cb3[r0.x+2].xyzw, r2.xyzw);
  r0.xyz = r3.xyz + r0.yzw;
  o9.xyz = max(float3(0,0,0), r0.xyz);
  o10.yzw = float3(0,0,0);
  r0.xyzw = cb4[1].xyzw * r1.yyyy;
  r0.xyzw = cb4[0].xyzw * r1.xxxx + r0.xyzw;
  r0.xyzw = cb4[2].xyzw * r1.zzzz + r0.xyzw;
  o11.xyzw = cb4[3].xyzw + r0.xyzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.164 on Sun Nov  2 16:38:32 2025
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz
// NORMAL                   0   xyz         1     NONE   float   xyz
// TANGENT                  0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xyzw        3     NONE   float   xyzw
// TEXCOORD                 1   xyzw        4     NONE   float   xyzw
// SV_InstanceID            0   x           5   INSTID    uint   x
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// CUSTOM_INSTANCE_ID       0   x           1     NONE    uint   x
// TEXCOORD                 0   xyz         2     NONE   float   xyz
// TEXCOORD                 1   xyz         3     NONE   float   xyz
// TEXCOORD                 2   xyzw        4     NONE   float   xyzw
// TEXCOORD                 3   xyzw        5     NONE   float   xyzw
// TEXCOORD                 4   xyzw        6     NONE   float   xyzw
// TEXCOORD                 5   xyz         7     NONE   float   xyz
// TEXCOORD                 6   xy          8     NONE   float   xy
// TEXCOORD                 7   xyz         9     NONE   float   xyz
// TEXCOORD                 8   xyzw       10     NONE   float   xyzw
// TEXCOORD                 9   xyzw       11     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer CB0[65], immediateIndexed
dcl_constantbuffer CB1[1], immediateIndexed
dcl_constantbuffer CB2[15], dynamicIndexed
dcl_constantbuffer CB3[14], dynamicIndexed
dcl_constantbuffer CB4[4], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_input v3.xyzw
dcl_input v4.xyzw
dcl_input_sgv v5.x, instance_id
dcl_output_siv o0.xyzw, position
dcl_output o1.x
dcl_output o2.xyz
dcl_output o3.xyz
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyz
dcl_output o8.xy
dcl_output o9.xyz
dcl_output o10.xyzw
dcl_output o11.xyzw
dcl_temps 5
iadd r0.x, v5.x, cb1[0].x
ishl r0.y, r0.x, l(3)
imul null, r0.x, r0.x, l(7)
mul r1.xyz, v0.yyyy, cb2[r0.y + 1].xyzx
mad r1.xyz, cb2[r0.y + 0].xyzx, v0.xxxx, r1.xyzx
mad r1.xyz, cb2[r0.y + 2].xyzx, v0.zzzz, r1.xyzx
add r1.xyz, r1.xyzx, cb2[r0.y + 3].xyzx
mul r2.xyzw, r1.yyyy, cb0[62].xyzw
mad r2.xyzw, cb0[61].xyzw, r1.xxxx, r2.xyzw
mad r2.xyzw, cb0[63].xyzw, r1.zzzz, r2.xyzw
add r2.xyzw, r2.xyzw, cb0[64].xyzw
mov o0.xyzw, r2.xyzw
div r0.z, r2.z, cb0[12].y
add r0.z, -r0.z, l(1.000000)
mul r0.z, r0.z, cb0[12].z
max r0.z, r0.z, l(0.000000)
mad_sat o10.x, r0.z, cb0[47].z, cb0[47].w
mov o1.x, v5.x
mov o2.xyz, r1.xyzx
dp3 r2.x, v1.xyzx, cb2[r0.y + 4].xyzx
dp3 r2.y, v1.xyzx, cb2[r0.y + 5].xyzx
dp3 r2.z, v1.xyzx, cb2[r0.y + 6].xyzx
dp3 r0.z, r2.xyzx, r2.xyzx
max r0.z, r0.z, l(1.175494351E-38)
rsq r0.z, r0.z
mul r2.xyz, r0.zzzz, r2.xyzx
mov o3.xyz, r2.xyzx
mul r3.xyz, v2.yyyy, cb2[r0.y + 1].xyzx
mad r3.xyz, cb2[r0.y + 0].xyzx, v2.xxxx, r3.xyzx
mad r0.yzw, cb2[r0.y + 2].xxyz, v2.zzzz, r3.xxyz
dp3 r1.w, r0.yzwy, r0.yzwy
max r1.w, r1.w, l(1.175494351E-38)
rsq r1.w, r1.w
mul o4.xyz, r0.yzwy, r1.wwww
mov o4.w, v2.w
mov o5.xyzw, v3.xyzw
mov o6.xyzw, v4.xyzw
add o7.xyz, -r1.xyzx, cb0[11].xyzx
mov o8.xy, l(0,0,0,0)
mul r0.y, r2.y, r2.y
mad r0.y, r2.x, r2.x, -r0.y
mul r3.xyzw, r2.yzzx, r2.xyzz
dp4 r4.x, cb3[r0.x + 3].xyzw, r3.xyzw
dp4 r4.y, cb3[r0.x + 4].xyzw, r3.xyzw
dp4 r4.z, cb3[r0.x + 5].xyzw, r3.xyzw
mad r0.yzw, cb3[r0.x + 6].xxyz, r0.yyyy, r4.xxyz
mov r2.w, l(1.000000)
dp4 r3.x, cb3[r0.x + 0].xyzw, r2.xyzw
dp4 r3.y, cb3[r0.x + 1].xyzw, r2.xyzw
dp4 r3.z, cb3[r0.x + 2].xyzw, r2.xyzw
add r0.xyz, r0.yzwy, r3.xyzx
max o9.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mov o10.yzw, l(0,0,0,0)
mul r0.xyzw, r1.yyyy, cb4[1].xyzw
mad r0.xyzw, cb4[0].xyzw, r1.xxxx, r0.xyzw
mad r0.xyzw, cb4[2].xyzw, r1.zzzz, r0.xyzw
add o11.xyzw, r0.xyzw, cb4[3].xyzw
ret
// Approximately 0 instruction slots used

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