citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

gl_vshader.glsl (442B)


      1 uniform mat4 u_matViewProjection;
      2 
      3 attribute vec4 a_glyph_vertex;
      4 
      5 varying vec4 v_glyph;
      6 
      7 vec4
      8 glyph_vertex_transcode (vec2 v)
      9 {
     10   ivec2 g = ivec2 (v);
     11   ivec2 corner = ivec2 (mod (v, 2.));
     12   g /= 2;
     13   ivec2 nominal_size = ivec2 (mod (vec2(g), 64.));
     14   return vec4 (corner * nominal_size, g * 4);
     15 }
     16 
     17 void
     18 main()
     19 {
     20   gl_Position = u_matViewProjection * vec4 (a_glyph_vertex.xy, 0, 1);
     21   v_glyph = glyph_vertex_transcode (a_glyph_vertex.zw);
     22 }