-
-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shaders: Implement hud shaders for OpenGL.
- Loading branch information
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.