Skip to content

Commit 7cb1cbb

Browse files
committed
shaders: Add GLSL port of editor.
1 parent 069233f commit 7cb1cbb

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

res/gamedata/shaders/gl/editor.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_editor.h"
3+
4+
uniform float4 tfactor;
5+
v2p _main (vf i)
6+
{
7+
v2p o;
8+
9+
o.P = mul (m_WVP, i.P); // xform, input in world coords
10+
o.C = tfactor*i.C;
11+
12+
return o;
13+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
out gl_PerVertex { vec4 gl_Position; };
3+
4+
struct vf
5+
{
6+
float4 C ; // COLOR0;
7+
float4 P ; // POSITION;
8+
};
9+
10+
struct v2p
11+
{
12+
float4 C ; // COLOR0;
13+
float4 P ; // SV_Position;
14+
};
15+
16+
layout(location = COLOR0) in float4 v_editor_C ; // COLOR0;
17+
layout(location = POSITION) in float4 v_editor_P ; // POSITION;
18+
19+
layout(location = COLOR0) out float4 v2p_editor_C ; // COLOR0;
20+
21+
v2p _main (vf i);
22+
23+
void main()
24+
{
25+
vf I;
26+
I.C = v_editor_C;
27+
I.P = v_editor_P;
28+
29+
v2p O = _main (I);
30+
31+
v2p_editor_C = O.C;
32+
gl_Position = O.P;
33+
}

0 commit comments

Comments
 (0)