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

Premultiply alpha of RGBA u8 images #2095

Merged
merged 2 commits into from May 12, 2023
Merged

Premultiply alpha of RGBA u8 images #2095

merged 2 commits into from May 12, 2023

Conversation

emilk
Copy link
Member

@emilk emilk commented May 12, 2023

What

This makes RGBA u8 images with alpha show up correctly

Checklist

PR Build Summary: https://build.rerun.io/pr/2095

@emilk emilk added 🪳 bug Something isn't working 📺 re_viewer affects re_viewer itself labels May 12, 2023
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

why not on the gpu?

@emilk
Copy link
Member Author

emilk commented May 12, 2023

Because pre-multiplication needs to be done before texture filtering, and we use textureSampleLevel for Rgba8UnormSrgb. We could switch to using our own software filtering in all cases, but that's a much bigger PR. I'll add a comment in the code.

@emilk
Copy link
Member Author

emilk commented May 12, 2023

We need to take a proper pass over all things alpha when we start working on transparency for real. This is just a quick fix to make transparent PNGs not look like crap

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

convincing!

@emilk emilk merged commit 51e703f into main May 12, 2023
15 checks passed
@emilk emilk deleted the emilk/premultiply-alpha branch May 12, 2023 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working 📺 re_viewer affects re_viewer itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants