citrun

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

gl_vshader_glsl.h (487B)


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