Skip to content

Commit 3e02daf

Browse files
committed
shaders: Implement hud shaders for OpenGL.
1 parent ed77133 commit 3e02daf

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

res/gamedata/shaders/gl/hud3d.ps

126 Bytes
Binary file not shown.

res/gamedata/shaders/gl/hud3d.vs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "common.h"
2+
#include "iostructs\v_TL.h"
3+
4+
v2p_TL _main (v_TL I)
5+
{
6+
v2p_TL O;
7+
8+
O.Tex0 = I.Tex0;
9+
O.HPos = I.P;
10+
O.P.w = 1;
11+
O.P = mul( m_WVP, O.P );
12+
return O;
13+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include "common_iostructs.h"
2+
//#include "common.h"
3+
#include "iostructs\v2p_TL0uv.h"
4+
5+
uniform float4 screen_res; // Screen resolution (x-Width,y-Height, zw - 1/resolution)
6+
7+
//////////////////////////////////////////////////////////////////////////////////////////
8+
// Vertex
9+
v2p_TL0uv _main ( v_TL0uv I )
10+
{
11+
v2p_TL0uv O;
12+
13+
{
14+
I.P.xy += 0.5f;
15+
// O.HPos.x = I.P.x/1024 * 2 - 1;
16+
// O.HPos.y = (I.P.y/768 * 2 - 1)*-1;
17+
O.HPos.x = I.P.x * screen_res.z * 2 - 1;
18+
O.HPos.y = (I.P.y * screen_res.w * 2 - 1)*-1;
19+
O.HPos.zw = I.P.zw;
20+
}
21+
22+
O.Color = I.Color.bgra; // swizzle vertex colour
23+
24+
return O;
25+
}
275 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)