Skip to content

Conversation

@yihleego
Copy link

Before

2025-03-20 12 19 23

After

2025-03-20 12 18 13

@Game4all
Copy link
Owner

Hey, thanks for the fix !
The colors do look better with your changes, however I'm curious whether you have any reference for the gamma function introduced in your changes.

@yihleego
Copy link
Author

Hello :D,

When we pass a color as raw floats to Bevy, Bevy expects we to pre-convert them to linear, So I just converted the Srgba to LinearRgba, the formula:

$$ \text{linearRGB} = \begin{cases} \frac{\text{sRGB}}{12.92}, & \text{sRGB} \leq 0.04045 \\ \left(\frac{\text{sRGB} + 0.055}{1.055}\right)^{2.4}, & \text{sRGB} > 0.04045 \end{cases} $$

See also: bevyengine/bevy#2783

@Game4all
Copy link
Owner

@yihleego sorry for the very delayed response. Can you reference the linked discussion in a code comment so that this doesn't get lost, this is ready to go afterwards

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