1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 22:30:03 -04:00

Fix alpha blending in WebGL2 backend (#650)

Add a render-to-texture step with an sRGBA8 texture
This commit is contained in:
AsmPrgmC3
2021-08-25 21:28:42 +02:00
committed by GitHub
parent a256337856
commit 31a1882997
11 changed files with 230 additions and 54 deletions

View File

@@ -39,9 +39,8 @@ impl epi::App for ColorTest {
if frame.is_web() {
ui.colored_label(
RED,
"NOTE: The WebGL backend does NOT pass the color test."
"NOTE: The WebGL1 backend does NOT pass the color test. The WebGL2 backend does."
);
ui.small("This is because WebGL does not support a linear framebuffer blending (not even WebGL2!).\nMaybe when WebGL3 becomes mainstream in 2030 the web can finally get colors right?");
ui.separator();
}
ScrollArea::auto_sized().show(ui, |ui| {

View File

@@ -12,7 +12,7 @@ impl Default for Painting {
fn default() -> Self {
Self {
lines: Default::default(),
stroke: Stroke::new(2.0, Color32::LIGHT_BLUE), // Thin strokes looks bad on web
stroke: Stroke::new(1.0, Color32::LIGHT_BLUE),
}
}
}