Skip to content

Commit

Permalink
shaders: Implement hud shaders for OpenGL.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Mar 3, 2016
1 parent ed77133 commit 3e02daf
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
Binary file added res/gamedata/shaders/gl/hud3d.ps
Binary file not shown.
13 changes: 13 additions & 0 deletions res/gamedata/shaders/gl/hud3d.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "common.h"
#include "iostructs\v_TL.h"

v2p_TL _main (v_TL I)
{
v2p_TL O;

O.Tex0 = I.Tex0;
O.HPos = I.P;
O.P.w = 1;
O.P = mul( m_WVP, O.P );
return O;
}
25 changes: 25 additions & 0 deletions res/gamedata/shaders/gl/hud_crosshair.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "common_iostructs.h"
//#include "common.h"
#include "iostructs\v2p_TL0uv.h"

uniform float4 screen_res; // Screen resolution (x-Width,y-Height, zw - 1/resolution)

//////////////////////////////////////////////////////////////////////////////////////////
// Vertex
v2p_TL0uv _main ( v_TL0uv I )
{
v2p_TL0uv O;

{
I.P.xy += 0.5f;
// O.HPos.x = I.P.x/1024 * 2 - 1;
// O.HPos.y = (I.P.y/768 * 2 - 1)*-1;
O.HPos.x = I.P.x * screen_res.z * 2 - 1;
O.HPos.y = (I.P.y * screen_res.w * 2 - 1)*-1;
O.HPos.zw = I.P.zw;
}

O.Color = I.Color.bgra; // swizzle vertex colour

return O;
}
Binary file added res/gamedata/shaders/gl/hud_font.ps
Binary file not shown.

0 comments on commit 3e02daf

Please sign in to comment.