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:
@@ -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| {
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user