// ---- Created with 3Dmigoto v0.6.164 on Mon Aug 18 19:06:58 2025

cbuffer _Globals : register(b0)
{
  float4 c130_GlobalSceneParams : packoffset(c15);
  float3 d001_CameraPosition : packoffset(c4);
  float4 n005_RenderTargetSizesInv : packoffset(c9);
  float4 c000_AmbientColor : packoffset(c23);
  float4 c001_AmbientColor2 : packoffset(c24);
  float2 D013_SpecularPowerAndLevel : packoffset(c64);
  float D017_EnvMapAmount : packoffset(c65);
  float D350_ForcedWorldNormalZ : packoffset(c66);
  float4 c025_VisualColorModulator : packoffset(c99);
}

SamplerState s110_DynamicAOTexture_sampler_s : register(s1);
SamplerState S000_DiffuseTexture_sampler_s : register(s8);
SamplerState S002_SpecularLevelTexture_sampler_s : register(s9);
SamplerState S060_EnvCubeTexture_sampler_s : register(s10);
Texture2D<float4> s110_DynamicAOTexture : register(t1);
Texture2D<float4> S000_DiffuseTexture : register(t8);
Texture2D<float4> S002_SpecularLevelTexture : register(t9);
TextureCube<float4> S060_EnvCubeTexture : register(t10);

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

cbuffer cb10 : register(b10)
{
  float4 cb10[100];
}


// 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,r2,r3;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = d001_CameraPosition.xyz + -v1.xyz;
  
float4 s = StereoParams.Load(0);
float4 testeo = IniParams.Load(int2(90,0));   
float fov = sqrt(cb13[0].x*cb13[0].x+cb13[0].y*cb13[0].y+cb13[0].z*cb13[0].z);
r0.x += s.x * s.y * cb13[6].x /fov ;
r0.y += s.x * s.y * cb13[6].y /fov ;
r0.z += s.x * s.y * cb13[6].z /fov ; 

  
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  r0.xyz = r0.xyz * r0.www;
  r0.w = dot(v3.xyz, v3.xyz);
  r0.w = rsqrt(r0.w);
  r1.xyz = v3.xyz * r0.www;
  r0.w = v3.z * r0.w + 1;
  r0.w = 0.5 * r0.w;
  r1.w = dot(r0.xyz, r1.xyz);
  r1.w = r1.w + r1.w;
  r0.xyz = r1.xyz * -r1.www + r0.xyz;
  r0.xyz = S060_EnvCubeTexture.Sample(S060_EnvCubeTexture_sampler_s, r0.xyz).xyz;
  r0.xyz = D017_EnvMapAmount * r0.xyz;
  r1.x = S002_SpecularLevelTexture.Sample(S002_SpecularLevelTexture_sampler_s, v2.xy).x;
  r0.xyz = r1.xxx * r0.xyz;
  r1.xyzw = S000_DiffuseTexture.Sample(S000_DiffuseTexture_sampler_s, v2.xy).xyzw;
  r2.x = 1 + -r1.w;
  r0.xyz = r2.xxx * r0.xyz;
  r0.xyz = c025_VisualColorModulator.xyz * r0.xyz;
  r0.xyz = c025_VisualColorModulator.www * r0.xyz;
  r2.xyz = c001_AmbientColor2.xyz + -c000_AmbientColor.xyz;
  r2.xyz = r0.www * r2.xyz + c000_AmbientColor.xyz;
  r3.xy = v0.xy * n005_RenderTargetSizesInv.zw + n005_RenderTargetSizesInv.xy;
  r0.w = s110_DynamicAOTexture.Sample(s110_DynamicAOTexture_sampler_s, r3.xy).w;
  r2.xyz = r2.xyz * r0.www;
  r2.w = 1;
  r1.xyzw = r2.xyzw * r1.xyzw;
  r1.xyzw = c025_VisualColorModulator.xyzw * r1.xyzw;
  r1.xyz = r1.www * r1.xyz + r0.xyz;
  r0.xyzw = max(float4(0,0,0,0), r1.xyzw);
  o0.w = min(1, r0.w);
  o0.xyz = r0.xyz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.164 on Mon Aug 18 19:06:58 2025
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 c130_GlobalSceneParams;     // Offset:  240 Size:    16 [unused]
//   float3 d001_CameraPosition;        // Offset:   64 Size:    12
//   float4 n005_RenderTargetSizesInv;  // Offset:  144 Size:    16
//   float4 c000_AmbientColor;          // Offset:  368 Size:    16
//   float4 c001_AmbientColor2;         // Offset:  384 Size:    16
//   float2 D013_SpecularPowerAndLevel; // Offset: 1024 Size:     8 [unused]
//   float D017_EnvMapAmount;           // Offset: 1040 Size:     4
//   float D350_ForcedWorldNormalZ;     // Offset: 1056 Size:     4 [unused]
//   float4 c025_VisualColorModulator;  // Offset: 1584 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// s110_DynamicAOTexture_sampler     sampler      NA          NA    1        1
// S000_DiffuseTexture_sampler       sampler      NA          NA    8        1
// S002_SpecularLevelTexture_sampler    sampler      NA          NA    9        1
// S060_EnvCubeTexture_sampler       sampler      NA          NA   10        1
// s110_DynamicAOTexture             texture  float4          2d    1        1
// S000_DiffuseTexture               texture  float4          2d    8        1
// S002_SpecularLevelTexture         texture  float4          2d    9        1
// S060_EnvCubeTexture               texture  float4        cube   10        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// TEXCOORD                 0   xyzw        1     NONE   float   xyz
// TEXCOORD                 1   xyzw        2     NONE   float   xy
// TEXCOORD                 2   xyzw        3     NONE   float   xyz
//
//
// 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[100], immediateIndexed
dcl_sampler s1, mode_default
dcl_sampler s8, mode_default
dcl_sampler s9, mode_default
dcl_sampler s10, mode_default
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texturecube (float,float,float,float) t10
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyz
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xyz
dcl_output o0.xyzw
dcl_temps 4
add r0.xyz, -v1.xyzx, cb0[4].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3 r0.w, v3.xyzx, v3.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, v3.xyzx
mad r0.w, v3.z, r0.w, l(1.000000)
mul r0.w, r0.w, l(0.500000)
dp3 r1.w, r0.xyzx, r1.xyzx
add r1.w, r1.w, r1.w
mad r0.xyz, r1.xyzx, -r1.wwww, r0.xyzx
sample_indexable(texturecube)(float,float,float,float) r0.xyz, r0.xyzx, t10.xyzw, s10
mul r0.xyz, r0.xyzx, cb0[65].xxxx
sample_indexable(texture2d)(float,float,float,float) r1.x, v2.xyxx, t9.xyzw, s9
mul r0.xyz, r0.xyzx, r1.xxxx
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, v2.xyxx, t8.xyzw, s8
add r2.x, -r1.w, l(1.000000)
mul r0.xyz, r0.xyzx, r2.xxxx
mul r0.xyz, r0.xyzx, cb0[99].xyzx
mul r0.xyz, r0.xyzx, cb0[99].wwww
add r2.xyz, -cb0[23].xyzx, cb0[24].xyzx
mad r2.xyz, r0.wwww, r2.xyzx, cb0[23].xyzx
mad r3.xy, v0.xyxx, cb0[9].zwzz, cb0[9].xyxx
sample_indexable(texture2d)(float,float,float,float) r0.w, r3.xyxx, t1.xyzw, s1
mul r2.xyz, r0.wwww, r2.xyzx
mov r2.w, l(1.000000)
mul r1.xyzw, r1.xyzw, r2.xyzw
mul r1.xyzw, r1.xyzw, cb0[99].xyzw
mad r1.xyz, r1.wwww, r1.xyzx, r0.xyzx
max r0.xyzw, r1.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
min o0.w, r0.w, l(1.000000)
mov o0.xyz, r0.xyzx
ret
// Approximately 34 instruction slots used

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