polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

ui.v.glsl (375B)


      1 #include profile
      2 
      3 in vec3 position;
      4 in vec2 tex_coords;
      5 
      6 out vec3 v_color;
      7 out vec2 v_tex_coords;
      8 
      9 uniform mat4 mvp;
     10 uniform vec2 uipos;
     11 uniform vec2 uisize;
     12 
     13 void main()
     14 {
     15     vec2 v2_pos = uipos + uisize * (position.xy - vec2(0.5, 0.5));
     16     vec4 v4_pos = vec4(v2_pos, 0.0, 1.0) ;
     17     gl_Position = mvp * v4_pos;
     18 
     19     v_tex_coords = tex_coords;
     20     v_color = v4_pos.xyz;
     21 }