//Sun rays position VS 1. Desert.
// ---- Created with geo-11 v0.7.11 on Sun Oct  4 11:14:52 2026

cbuffer TransformCB : register(b4)
{
  float4 mtx_palette[32] : packoffset(c0);
  float4 y_scale : packoffset(c32);
}

cbuffer PerDrawCB : register(b1)
{

  struct
  {
    uint width;
    uint height;
    bool linear_filtering;
  } textures[7] : packoffset(c0);

  float4 combiner_inputs[6] : packoffset(c7);
  float4 fog_color : packoffset(c13);
  float4 grayscale_color : packoffset(c14);
  float4 uv_transform[2] : packoffset(c15);
  float4 texture_clamp[2] : packoffset(c17);
  float4 fog_params : packoffset(c19);
  float4 palette_params[2] : packoffset(c20);
  float4 lod_params : packoffset(c22);
  float4 uCustom[32] : packoffset(c23);
  float4 debug_tint : packoffset(c55);
}



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


void main(
  float4 v0 : POSITION0,
  float v1 : MTXSLOT0,
  float4 v2 : TEXCOORD0,
  float2 v3 : TEXCOORD1,
  float4 v4 : SHADE0,
  out float4 o0 : SV_POSITION0,
  out float2 o1 : TEXCOORD0,
  out float2 p1 : TEXCOORD1,
  out float4 o2 : SHADE0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  
  r0.x = 0.5 + v1.x;
  r0.x = (int)r0.x;
  r0.x = (uint)r0.x << 2;
  r0.yzw = (int3)r0.xxx + int3(1,2,3);
  r1.xyzw = mtx_palette[r0.y].xyzw * v0.yyyy;
  r1.xyzw = v0.xxxx * mtx_palette[r0.x].xyzw + r1.xyzw;
  r1.xyzw = v0.zzzz * mtx_palette[r0.z].xyzw + r1.xyzw;
  r0.xyzw = v0.wwww * mtx_palette[r0.w].xyzw + r1.xyzw;
  r0.z = r0.z + r0.w;
  o0.z = 0.5 * r0.z;
  o0.y = y_scale.x * r0.y;
  o0.xw = r0.xw;
  
  if (o0.w==1.0) {
    o0.x+=stereo.x;
  }
  
  o1.xy = v2.xy * uv_transform[0].xz + uv_transform[0].yw;
  p1.xy = v3.xy * uv_transform[1].xz + uv_transform[1].yw;
  o2.xyzw = v4.xyzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.7.11 on Sun Oct  4 11:14:52 2026
//
//
// Buffer Definitions:
//
// cbuffer TransformCB
// {
//
//   float4 mtx_palette[32];            // Offset:    0 Size:   512
//   float4 y_scale;                    // Offset:  512 Size:    16
//
// }
//
// cbuffer PerDrawCB
// {
//
//   struct
//   {
//
//       uint width;                    // Offset:    0
//       uint height;                   // Offset:    4
//       bool linear_filtering;         // Offset:    8
//
//   } textures[7];                     // Offset:    0 Size:   108 [unused]
//   float4 combiner_inputs[6];         // Offset:  112 Size:    96 [unused]
//   float4 fog_color;                  // Offset:  208 Size:    16 [unused]
//   float4 grayscale_color;            // Offset:  224 Size:    16 [unused]
//   float4 uv_transform[2];            // Offset:  240 Size:    32
//   float4 texture_clamp[2];           // Offset:  272 Size:    32 [unused]
//   float4 fog_params;                 // Offset:  304 Size:    16 [unused]
//   float4 palette_params[2];          // Offset:  320 Size:    32 [unused]
//   float4 lod_params;                 // Offset:  352 Size:    16 [unused]
//   float4 uCustom[32];                // Offset:  368 Size:   512 [unused]
//   float4 debug_tint;                 // Offset:  880 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PerDrawCB                         cbuffer      NA          NA    1        1
// TransformCB                       cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// MTXSLOT                  0   x           1     NONE   float   x
// TEXCOORD                 0   xy          2     NONE   float   xy
// TEXCOORD                 1   xy          3     NONE   float   xy
// SHADE                    0   xyzw        4     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
// TEXCOORD                 1     zw        1     NONE   float     zw
// SHADE                    0   xyzw        2     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer CB4[33], dynamicIndexed
dcl_constantbuffer CB1[17], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.x
dcl_input v2.xy
dcl_input v3.xy
dcl_input v4.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o1.zw
dcl_output o2.xyzw
dcl_temps 2
add r0.x, v1.x, l(0.500000)
ftoi r0.x, r0.x
ishl r0.x, r0.x, l(2)
iadd r0.yzw, r0.xxxx, l(0, 1, 2, 3)
mul r1.xyzw, v0.yyyy, cb4[r0.y + 0].xyzw
mad r1.xyzw, v0.xxxx, cb4[r0.x + 0].xyzw, r1.xyzw
mad r1.xyzw, v0.zzzz, cb4[r0.z + 0].xyzw, r1.xyzw
mad r0.xyzw, v0.wwww, cb4[r0.w + 0].xyzw, r1.xyzw
add r0.z, r0.w, r0.z
mul o0.z, r0.z, l(0.500000)
mul o0.y, r0.y, cb4[32].x
mov o0.xw, r0.xxxw
mad o1.xy, v2.xyxx, cb1[15].xzxx, cb1[15].ywyy
mad o1.zw, v3.xxxy, cb1[16].xxxz, cb1[16].yyyw
mov o2.xyzw, v4.xyzw
ret
// Approximately 16 instruction slots used

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