From fc743d63b4829f776928408dc997149682404c14 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 6 Nov 2024 13:33:43 +0100 Subject: [PATCH] Add link to helpful article in font alpha TODO --- crates/epaint/src/image.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/epaint/src/image.rs b/crates/epaint/src/image.rs index 454969d75cb..c5b6eef8eda 100644 --- a/crates/epaint/src/image.rs +++ b/crates/epaint/src/image.rs @@ -301,7 +301,9 @@ impl FontImage { /// If you are having problems with text looking skinny and pixelated, try using a low gamma, e.g. `0.4`. #[inline] pub fn srgba_pixels(&self, gamma: Option) -> impl ExactSizeIterator + '_ { - let gamma = gamma.unwrap_or(0.55); // TODO(emilk): this default coverage gamma is a magic constant, chosen by eye. I don't even know why we need it. + // TODO(emilk): this default coverage gamma is a magic constant, chosen by eye. I don't even know why we need it. + // Maybe we need to implement the ideas in https://hikogui.org/2022/10/24/the-trouble-with-anti-aliasing.html + let gamma = gamma.unwrap_or(0.55); self.pixels.iter().map(move |coverage| { let alpha = coverage.powf(gamma); // We want to multiply with `vec4(alpha)` in the fragment shader: