//Car Lights red
cbuffer PER_BATCH : register(b0)
{
  float4 lightMaterialColor : packoffset(c0);
  float4 artistParams : packoffset(c1);
  row_major float4x4 viewProjMat : packoffset(c2);
  float4 ResInfoDiffuse : packoffset(c6);
}

cbuffer PER_FRAME : register(b3)
{
  float4 g_VS_ScreenSize : packoffset(c7);
}

Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main( 
  float4 v0 : POSITION0,
  float2 v1 : TEXCOORD0,
  float4 v2 : COLOR0,
  out float4 o0 : SV_Position0,
  out float2 o1 : TEXCOORD0,
  out float4 o2 : COLOR0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = max(ResInfoDiffuse.x, ResInfoDiffuse.y);
  r0.xy = ResInfoDiffuse.xy / r0.xx;
  r0.zw = v1.xy * float2(2,2) + float2(-1,-1);
  r0.xy = r0.zw * r0.xy;
  r0.z = max(g_VS_ScreenSize.x, g_VS_ScreenSize.y);
  r0.zw = g_VS_ScreenSize.yx / r0.zz;
  r0.xy = r0.xy * r0.zw;
  r1.xyz = viewProjMat._m10_m11_m13 * v0.yyy;
  r1.xyz = v0.xxx * viewProjMat._m00_m01_m03 + r1.xyz;
  r1.xyz = v0.zzz * viewProjMat._m20_m21_m23 + r1.xyz;
  r1.xyz = viewProjMat._m30_m31_m33 + r1.xyz;
  r0.zw = r1.xy / r1.zz;
  o0.xy = r0.xy * artistParams.xx + r0.zw;
  o0.zw = float2(0,1);
  
      float4 stereo = StereoParams.Load(0);
  o0.x += stereo.x /2;
  
  o1.xy = v1.xy * float2(1,-1) + float2(0,1);
  r0.xyz = artistParams.yyy * lightMaterialColor.xyz;
  r0.w = saturate(artistParams.z);
  o2.xyz = r0.xyz * r0.www;
  o2.w = lightMaterialColor.w;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.2.1 on Sun Aug 30 15:47:28 2015
//
//
// Buffer Definitions: 
//
// cbuffer PER_BATCH
// {
//
//   float4 lightMaterialColor;         // Offset:    0 Size:    16
//   float4 artistParams;               // Offset:   16 Size:    16
//   row_major float4x4 viewProjMat;    // Offset:   32 Size:    64
//   float4 ResInfoDiffuse;             // Offset:   96 Size:    16
//
// }
//
// cbuffer PER_FRAME
// {
//
//   float4 g_VS_ScreenSize;            // Offset:  112 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PER_BATCH                         cbuffer      NA          NA    0        1
// PER_FRAME                         cbuffer      NA          NA    3        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyz 
// TEXCOORD                 0   xy          1     NONE   float   xy  
// COLOR                    0   xyzw        2     NONE   float       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
// COLOR                    0   xyzw        2     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[7], immediateIndexed
dcl_constantbuffer cb3[8], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyzw
dcl_temps 2
max r0.x, cb0[6].y, cb0[6].x
div r0.xy, cb0[6].xyxx, r0.xxxx
mad r0.zw, v1.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
mul r0.xy, r0.xyxx, r0.zwzz
max r0.z, cb3[7].y, cb3[7].x
div r0.zw, cb3[7].yyyx, r0.zzzz
mul r0.xy, r0.zwzz, r0.xyxx
mul r1.xyz, v0.yyyy, cb0[3].xywx
mad r1.xyz, v0.xxxx, cb0[2].xywx, r1.xyzx
mad r1.xyz, v0.zzzz, cb0[4].xywx, r1.xyzx
add r1.xyz, r1.xyzx, cb0[5].xywx
div r0.zw, r1.xxxy, r1.zzzz
mad o0.xy, r0.xyxx, cb0[1].xxxx, r0.zwzz
mov o0.zw, l(0,0,0,1.000000)
mad o1.xy, v1.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000), l(0.000000, 1.000000, 0.000000, 0.000000)
mul r0.xyz, cb0[0].xyzx, cb0[1].yyyy
mov_sat r0.w, cb0[1].z
mul o2.xyz, r0.wwww, r0.xyzx
mov o2.w, cb0[0].w
ret 
// Approximately 20 instruction slots used

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