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

Support non-sRGB texture formats #3903

Closed
wants to merge 21 commits into from
Closed

Support non-sRGB texture formats #3903

wants to merge 21 commits into from

Conversation

nia-e
Copy link

@nia-e nia-e commented Feb 9, 2022

Objective

Enables a workaround for #3897 by setting a no_srgb feature. Should allow native Wayland support on systems that may not support sRGB directly e.g. (some video cards) Nvidia on Wayland presently.

Solution

Gamma correction is enabled conditionally based on whether the feature is enabled.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Feb 9, 2022
@mockersf
Copy link
Member

mockersf commented Feb 9, 2022

Having it as a feature would mean that you will have to distribute several different versions of your binaries depending on your gpu on wayland... would it be possible to detect at runtime?

@nia-e
Copy link
Author

nia-e commented Feb 9, 2022

Possibly, though having the option of disabling it entirely should make it work regardless of GPU. I was discussing this in the official Discord under #rendering-dev, see here. I personally don't have the experience to implement this, and it seems like a large undertaking, so I was hoping this is a viable workaround in the meantime.

@mockersf
Copy link
Member

mockersf commented Feb 9, 2022

having the option of disabling it entirely should make it work regardless of GPU.

Should it be enabled automatically with the wayland feature?

Sorry, I have zero knowledge of wayland, but I would like to avoid needing to enable several non-obvious features to support most cases.

@mockersf
Copy link
Member

mockersf commented Feb 9, 2022

Could you also mention the new feature in https://github.com/bevyengine/bevy/blob/main/docs/cargo_features.md?

@superdump
Copy link
Contributor

I think we should ask wgpu what the preferred texture format for the surface is and act based on that.

@nia-e
Copy link
Author

nia-e commented Feb 9, 2022

Could you also mention the new feature in https://github.com/bevyengine/bevy/blob/main/docs/cargo_features.md?

Done! Thanks for the heads up

@nia-e
Copy link
Author

nia-e commented Feb 9, 2022

having the option of disabling it entirely should make it work regardless of GPU.

Should it be enabled automatically with the wayland feature?

Sorry, I have zero knowledge of wayland, but I would like to avoid needing to enable several non-obvious features to support most cases.

It's usually fine on Wayland in general, at least in my experience. Seems like Nvidia is the only case where this doesn't work; wayland with sRGB is perfectly okay on my Intel iGPU, at least.

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Feb 9, 2022
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior O-Linux Specific to the Linux desktop operating system labels Feb 9, 2022
@nia-e nia-e changed the title Support non srgb Support non-sRGB texture formats Feb 9, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Linux Specific to the Linux desktop operating system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants