Skip to content

Commit

Permalink
Add link to helpful article in font alpha TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Nov 6, 2024
1 parent 5d6a58b commit fc743d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/epaint/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f32>) -> impl ExactSizeIterator<Item = Color32> + '_ {
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:
Expand Down

0 comments on commit fc743d6

Please sign in to comment.