From 3d3f2127a95dac364b2f3b521717c3d684c12901 Mon Sep 17 00:00:00 2001 From: Aljoscha Krettek Date: Mon, 6 Jan 2025 15:00:44 +0100 Subject: [PATCH] renderer/metal: demonstrate alpha "gain" for thickening fonts --- src/renderer/shaders/cell.metal | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderer/shaders/cell.metal b/src/renderer/shaders/cell.metal index 995a5a8bc..115416cbc 100644 --- a/src/renderer/shaders/cell.metal +++ b/src/renderer/shaders/cell.metal @@ -365,6 +365,12 @@ fragment float4 cell_text_fragment( // Then premult the texture color float a = textureGrayscale.sample(textureSampler, in.tex_coord).r; + + // Demonstrate how we can thicken fonts by applying some "gain" to the + // alpha we get from the texture. + // + // We could make this a configurable knob. + a = pow(a, 1 / 3.0f); premult = premult * a; return premult;