Skip to content

Calculate sky color using raw brightness without gamma correction #12654

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

Closed
wants to merge 1 commit into from

Conversation

x2048
Copy link
Contributor

@x2048 x2048 commented Aug 5, 2022

Fixes #10258

In the calculation of sky color I've replace light-curve-corrected perceptive brightness in night/dawn/day detection rules with light-curve-agnostic linear brightness based on time_of_day.

Time points for dawn are preserved at 4:45 to 5:00, symmetric time for dusk.

To do

This PR is Ready for Review.

How to test

  1. Add snippet from Client lighting parameters affect which sky colors are shown #10258 to devtest
  2. Change light curve parameters (lighting_alpha, lighting_beta, lighting_boost, display_gamma ...) to any valid value (e.g. bright nights etc.)
  3. Set time_speed to 576
  4. Enter the game and set time to 4:00
  5. Observe the transition of sky color from blue to green to red from 4:45 to 5:00, regardless of the light parameters.

@x2048 x2048 self-assigned this Aug 5, 2022
m_time_brightness = time_brightness;
m_sunlight_seen = sunlight_seen;
m_in_clouds = false;

bool is_dawn = (time_brightness >= 0.20 && time_brightness < 0.35);
bool is_dawn = (raw_time_brightness >= 0.395833f && raw_time_brightness < 0.416666f);
Copy link
Contributor

Choose a reason for hiding this comment

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

We can also pass both values in from the caller (game.cpp)?
(In that case we might want to rename time_brightness to adjusted_brightness - or something)

Generally there are more places where time_brightness and m_time_brightness are compared with fixed value. Do we need to look at those as well?

@sfan5
Copy link
Collaborator

sfan5 commented Aug 19, 2022

In case I don't get to it here's what I think is important to test:

  • take screenshots at various daytimes in 5.6
  • take the same screenshots with this PR
  • compare and make sure they're (nearly) identical

@rubenwardy rubenwardy added the Adoption needed The pull request needs someone to adopt it. Adoption welcomed! label Oct 2, 2023
@Zughy Zughy unassigned x2048 Jan 21, 2024
@sfan5 sfan5 closed this Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adoption needed The pull request needs someone to adopt it. Adoption welcomed! Bugfix 🐛 PRs that fix a bug @ Client / Audiovisuals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client lighting parameters affect which sky colors are shown
4 participants