Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear color values are now explicitely sent to the rendering backend as-is. #2666

Merged
merged 7 commits into from
Feb 4, 2023

Conversation

Wumpf
Copy link
Collaborator

@Wumpf Wumpf commented Feb 3, 2023

Previously, converting from Color32 to Rgba caused an srgb->linear conversion. This conversion is incorrect if the backbuffer doesn't perform automatic conversion from linear->srgb (lack of this conversion is generally what egui assumes!).

Manually tested on Mac native & web both with glow & wgpu.
(although I only checked on the exact clear color with wgpu in native and web, but this should be pretty universal)

…as-is.

Previously, converting from Color32 to Rgba caused an srgb->linear conversion. This conversion is incorrect if the backbuffer doesn't perform automatic conversion from linear->srgb (lack of this conversion is generally what egui assumes!).
@Wumpf Wumpf requested a review from emilk February 3, 2023 21:10
@Wumpf Wumpf changed the title Clear color values are not explicitely sent to the rendering backend as-is. Clear color values are now explicitely sent to the rendering backend as-is. Feb 3, 2023
@Wumpf Wumpf marked this pull request as draft February 3, 2023 21:16
@Wumpf
Copy link
Collaborator Author

Wumpf commented Feb 3, 2023

converted to draft, found an issue on web @ wgpu with this after all

@Wumpf
Copy link
Collaborator Author

Wumpf commented Feb 3, 2023

Was false alarm - the app ;) I tested with has a different eframe::App impl for web and native. Web had a similar background color but not the same.
So works as expected on web & native

@Wumpf Wumpf marked this pull request as ready for review February 3, 2023 21:36
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good find!

crates/eframe/src/epi.rs Outdated Show resolved Hide resolved
crates/ecolor/src/color32.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Wumpf and others added 3 commits February 4, 2023 10:29
Co-authored-by: Emil Ernerfeldt <[email protected]>
Co-authored-by: Emil Ernerfeldt <[email protected]>
@Wumpf
Copy link
Collaborator Author

Wumpf commented Feb 4, 2023

Thanks for fixing the comments and explaining srgb-gamma again. We talked about this not too long ago 🤔

crates/eframe/src/epi.rs Outdated Show resolved Hide resolved
@emilk emilk merged commit 8aa07e9 into master Feb 4, 2023
@emilk emilk deleted the fix-clear-color-space-issues branch February 4, 2023 10:02
lictex pushed a commit to lictex/egui that referenced this pull request Feb 5, 2023
…as-is. (emilk#2666)

* Clear color values are not explicitely sent to the rendering backend as-is.
Previously, converting from Color32 to Rgba caused an srgb->linear conversion. This conversion is incorrect if the backbuffer doesn't perform automatic conversion from linear->srgb (lack of this conversion is generally what egui assumes!).

* fill in pr numbers in changelog

* Epi comment fix

Co-authored-by: Emil Ernerfeldt <[email protected]>

* Color32 comment fix

Co-authored-by: Emil Ernerfeldt <[email protected]>

* move changelog line

* rename fix

* use backticks in doc

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants