//godrays, also pushes entire screen
// ---- Created with 3Dmigoto v1.2.67 on Mon Nov 27 00:13:46 2017

cbuffer VSCB_PostProcess : register(b11)
{
  float4 VSC_PPEdgeU[4] : packoffset(c0);
  float4 VSC_PPEdgeV[4] : packoffset(c4);
  float4 VSC_PPEdgePosOffset : packoffset(c8);
  float4x3 VSC_RainViewMatrix : packoffset(c9);
  float4x4 VSC_RainProjMatrix : packoffset(c12);
  float4 VSC_RainShiftScale : packoffset(c16);
  float4 VSC_RainMinBox : packoffset(c17);
  float4 VSC_RainMaxBox : packoffset(c18);
  float4 VSC_RainSeaLevel : packoffset(c19);
  float4 VSC_SSAOPixelOffsets : packoffset(c20);
  float4 VSC_SSAONoisePixelScale : packoffset(c21);
  float4 VSC_RotBlur_mA0 : packoffset(c22);
  float4 VSC_RotBlur_mA1 : packoffset(c23);
  float4 VSC_RotBlur_mA2 : packoffset(c24);
  float4 VSC_ProjConsts : packoffset(c25);
  float4 VSC_PPWetDistortPars : packoffset(c26);
  float4 VSC_PPWDSpeeds : packoffset(c27);
  float4 VSC_PPWDAmps : packoffset(c28);
  float4 VSC_PPWDPhases : packoffset(c29);
  float4 VSC_PPDynBlurPars0 : packoffset(c30);
  float4 VSC_PPDynBlurPars1 : packoffset(c31);
  float4 VSC_PPAAPars : packoffset(c32);
  float4 VSC_RainRCam : packoffset(c33);
  float4 VSC_RainDropParams : packoffset(c34);
  float4 VSC_RainMoveParams : packoffset(c35);
  float4 VSC_RainDir : packoffset(c36);
  float4 VSC_RainLightDir : packoffset(c37);
  float4 VSC_RainDropDir : packoffset(c38);
}
cbuffer NVStereoCB : register(b9)
{
  float nv_negative_separation_convergence;
  float nv_separation;
  float nv_unused;
  float nv_stereo_enabled;
}


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


void main(
  float3 v0 : POSITION0,
  float v1 : BLENDINDICES0,
  out float4 o0 : SV_POSITION0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD1,
  out float4 o3 : TEXCOORD2,
  out float4 o4 : TEXCOORD3)
{
  float4 r0,r9,r10,r11,r12;
  uint4 bitmask, uiDest;
  float4 fDest;

  r10.xyzw = VSC_PPEdgePosOffset.xyzw + v0.xyzz;
  r0.x = (uint)v1.x;
  o1.x = VSC_PPEdgeU[r0.x].x;
  o1.y = VSC_PPEdgeV[r0.x].x;
  o2.x = VSC_PPEdgeU[r0.x].y;
  o2.y = VSC_PPEdgeV[r0.x].y;
  o3.x = VSC_PPEdgeU[r0.x].z;
  o3.y = VSC_PPEdgeV[r0.x].z;
  o4.x = VSC_PPEdgeU[r0.x].w;
  o4.y = VSC_PPEdgeV[r0.x].w;

r9 = r10;
r12 = r10;

float4 stereo = StereoParams.Load(0);
float4 iniParams = IniParams.Load(0);
float4 ray = IniParams.Load(int2(2, 0));

if(ray.z == 1)
{
//r10.x += stereo.x * 1;
//o0.x -= stereo.x*(o0.w - stereo.y);
}

o0 = r10;

if(nv_stereo_enabled > 1)
{
o0.x += nv_separation * o0.w + nv_negative_separation_convergence;
}
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Buffer Definitions: 
//
// cbuffer VSCB_PostProcess
// {
//
//   float4 VSC_PPEdgeU[4];             // Offset:    0 Size:    64
//   float4 VSC_PPEdgeV[4];             // Offset:   64 Size:    64
//   float4 VSC_PPEdgePosOffset;        // Offset:  128 Size:    16
//   float4x3 VSC_RainViewMatrix;       // Offset:  144 Size:    48 [unused]
//   float4x4 VSC_RainProjMatrix;       // Offset:  192 Size:    64 [unused]
//   float4 VSC_RainShiftScale;         // Offset:  256 Size:    16 [unused]
//   float4 VSC_RainMinBox;             // Offset:  272 Size:    16 [unused]
//   float4 VSC_RainMaxBox;             // Offset:  288 Size:    16 [unused]
//   float4 VSC_RainSeaLevel;           // Offset:  304 Size:    16 [unused]
//   float4 VSC_SSAOPixelOffsets;       // Offset:  320 Size:    16 [unused]
//   float4 VSC_SSAONoisePixelScale;    // Offset:  336 Size:    16 [unused]
//   float4 VSC_RotBlur_mA0;            // Offset:  352 Size:    16 [unused]
//   float4 VSC_RotBlur_mA1;            // Offset:  368 Size:    16 [unused]
//   float4 VSC_RotBlur_mA2;            // Offset:  384 Size:    16 [unused]
//   float4 VSC_ProjConsts;             // Offset:  400 Size:    16 [unused]
//   float4 VSC_PPWetDistortPars;       // Offset:  416 Size:    16 [unused]
//   float4 VSC_PPWDSpeeds;             // Offset:  432 Size:    16 [unused]
//   float4 VSC_PPWDAmps;               // Offset:  448 Size:    16 [unused]
//   float4 VSC_PPWDPhases;             // Offset:  464 Size:    16 [unused]
//   float4 VSC_PPDynBlurPars0;         // Offset:  480 Size:    16 [unused]
//   float4 VSC_PPDynBlurPars1;         // Offset:  496 Size:    16 [unused]
//   float4 VSC_PPAAPars;               // Offset:  512 Size:    16 [unused]
//   float4 VSC_RainRCam;               // Offset:  528 Size:    16 [unused]
//   float4 VSC_RainDropParams;         // Offset:  544 Size:    16 [unused]
//   float4 VSC_RainMoveParams;         // Offset:  560 Size:    16 [unused]
//   float4 VSC_RainDir;                // Offset:  576 Size:    16 [unused]
//   float4 VSC_RainLightDir;           // Offset:  592 Size:    16 [unused]
//   float4 VSC_RainDropDir;            // Offset:  608 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// VSCB_PostProcess                  cbuffer      NA          NA   11        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz 
// BLENDINDICES             0   x           1     NONE   float   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xy  
// TEXCOORD                 1   xyzw        2     NONE   float   xy  
// TEXCOORD                 2   xyzw        3     NONE   float   xy  
// TEXCOORD                 3   xyzw        4     NONE   float   xy  
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb11[9], dynamicIndexed
dcl_input v0.xyz
dcl_input v1.x
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xy
dcl_output o3.xy
dcl_output o4.xy
dcl_temps 1
add o0.xyzw, v0.xyzz, cb11[8].xyzw
ftou r0.x, v1.x
mov o1.x, cb11[r0.x + 0].x
mov o1.y, cb11[r0.x + 4].x
mov o2.x, cb11[r0.x + 0].y
mov o2.y, cb11[r0.x + 4].y
mov o3.x, cb11[r0.x + 0].z
mov o3.y, cb11[r0.x + 4].z
mov o4.x, cb11[r0.x + 0].w
mov o4.y, cb11[r0.x + 4].w
ret 
// Approximately 11 instruction slots used

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


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HLSL errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Program Files (x86)\Arma 3\ShaderCache\1d35fa6a8e3613e8-vs_replace.txt(47,14-15): warning X3578: Output value 'o1' is not completely initialized
D:\Program Files (x86)\Arma 3\ShaderCache\1d35fa6a8e3613e8-vs_replace.txt(48,14-15): warning X3578: Output value 'o2' is not completely initialized
D:\Program Files (x86)\Arma 3\ShaderCache\1d35fa6a8e3613e8-vs_replace.txt(49,14-15): warning X3578: Output value 'o3' is not completely initialized
D:\Program Files (x86)\Arma 3\ShaderCache\1d35fa6a8e3613e8-vs_replace.txt(50,14-15): warning X3578: Output value 'o4' is not completely initialized
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
