static const char* fragmentSource20embedded = R"( #version 100 // This came from some tutorial, mentioning some drivers required this to function // properly but did not delve into why. precision highp float; varying vec2 fragmentTextureUV; varying vec4 fragmentColor; // diffuseTexture is a 2D texture sampler for diffuse texture. uniform sampler2D diffuseTexture; // colorMatrix will be an identity matrix for sprites and special for fonts // since fonts in GL 3.2 Core uses only RED channel on texture, multiply // by this matrix can convert that into argb for further use. uniform mat4 colorMatrix; // colorTint is an offset to keep the fonts from having a strange black edge // appearing around them that looks pretty bad. uniform vec4 colorTint; void main(void) { vec4 color = texture2D(diffuseTexture, fragmentTextureUV); gl_FragColor = colorTint + (colorMatrix * color); gl_FragColor = clamp(gl_FragColor, vec4(0,0,0,0), vec4(1,1,1,1)); gl_FragColor = (gl_FragColor) * fragmentColor; gl_FragColor = vec4(gl_FragColor.rgb * gl_FragColor.a, gl_FragColor.a); if (gl_FragColor.a < 0.01) { discard; } } )";