This project is my first dive into OpenGL and modern computer graphics, following learnopengl.com . The idea is to create a graphics engine completely from scratch using OdinLang.
The engine is very rudimentary, as most of my time has been spent developing its font rendering for an immediate mode gui.
For this engine's font rendering I chose to follow the research paper: Resolution Independent Curve Rendering using Programmable Graphics Hardware, 2005. It focuses on using real-time font rendering without bitmaps but with glyph triangulation and quadratic bezier calculations on the GPU in order to achieve resolution independent rendering.
For my implementation I made a simple TTF parser, which extracts ASCII glyphs and global data.
After parsing the according .ttf file, the engine triangulates every glyph's anchor points using delauney triangulation (also implemented by me, following Primitives for the manipulation of general subdivisions and the computation of Voronoi
, 1985) and then constrains the glyph's edges following this implementetion shown in the youtube series CAD From Scratch.
This results in something like so:

Applying a fragment shader so that it uses Loop/Blinn:
#version 450 core
uniform vec3 color;
uniform float smoothness;
uniform float cutoff;
in vec2 uv;
in float inner;
out vec4 frag_color;
float get_intensity(vec2 uv) {
// uv.z is 1 if outer curve, or -1 if inner curve
float g = (uv.x * uv.x - uv.y);
g *= inner;
float delta_g = sqrt(dFdx(g) * dFdx(g) + dFdy(g) * dFdy(g));
float dist = g;
if (delta_g > 0) {
dist /= delta_g;
}
float pixel_size = length(vec2(dFdx(dist), dFdy(dist)));
dist -= pixel_size * smoothness * 0.5;
float alpha = - dist / (pixel_size * smoothness);
return alpha;
}
void main() {
float alpha = get_intensity(uv);
if (alpha < cutoff)
discard;
frag_color = vec4(color, alpha);
}I then implemented the paper's anti-aliasing technique, which I still need to tinker with but I do not believe is good enough for modern rendering.
base anti-aliasing + MSAAx4 + subpixel

This implementation is not used industry-wise because of its complexity regarding for example triangulation, and the suboptimal anti-aliasing technique shown in the paper. Other techniques include:
- Simple bitmap rendering, which is using a quad and a glyph texture to render a single character. This does not produce resolution-independent rendering.
- Multi channel SDF (Signed distance function) rendering, which takes advantage of SDF bitmaps to generate higher resolution glyphs. Its generator including the master thesis regarding this technique can be found here


