mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Add link to helpful article in font alpha TODO
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user