Skip to content

Commit

Permalink
shaders: Add GLSL port of editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Mar 7, 2016
1 parent 069233f commit 7cb1cbb
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
13 changes: 13 additions & 0 deletions res/gamedata/shaders/gl/editor.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "common.h"
#include "iostructs\v_editor.h"

uniform float4 tfactor;
v2p _main (vf i)
{
v2p o;

o.P = mul (m_WVP, i.P); // xform, input in world coords
o.C = tfactor*i.C;

return o;
}
33 changes: 33 additions & 0 deletions res/gamedata/shaders/gl/iostructs/v_editor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

out gl_PerVertex { vec4 gl_Position; };

struct vf
{
float4 C ; // COLOR0;
float4 P ; // POSITION;
};

struct v2p
{
float4 C ; // COLOR0;
float4 P ; // SV_Position;
};

layout(location = COLOR0) in float4 v_editor_C ; // COLOR0;
layout(location = POSITION) in float4 v_editor_P ; // POSITION;

layout(location = COLOR0) out float4 v2p_editor_C ; // COLOR0;

v2p _main (vf i);

void main()
{
vf I;
I.C = v_editor_C;
I.P = v_editor_P;

v2p O = _main (I);

v2p_editor_C = O.C;
gl_Position = O.P;
}

0 comments on commit 7cb1cbb

Please sign in to comment.