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

Use sky API to obtain directional light source position #12662

Merged
merged 2 commits into from
Aug 17, 2022

Conversation

x2048
Copy link
Contributor

@x2048 x2048 commented Aug 7, 2022

Refactor calculation of sun/moon position to be in the Sky class, so that it is easy to use in e.g. shaders.
Fixes a bug where sun position on the sky and shadow direction are not aligned with high values of sky_body_orbit_tilt

To do

This PR is Ready for Review.

How to test

Test1

  1. Set sky_body_orbit_tilt = 30
  2. Enable dynamic shadows
  3. Start a game
  4. Set time to 10:00
  5. Align player's shadow with an object in the world (e.g. tree trunk or a stack a nodes).
  6. Look at the sun and check that the light source is behind the object.
  7. Perform the same test with moon at 22:00

Test2

  1. Set sky_body_orbit_tilt = 30
  2. Start a game (MTG)
  3. Set time to 6:00
  4. Look at the sun, the texture must not be rotated

@x2048 x2048 added @ Client / Audiovisuals Bugfix 🐛 PRs that fix a bug Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements labels Aug 7, 2022
@x2048 x2048 requested a review from sfan5 August 16, 2022 19:31
@x2048 x2048 merged commit 8c29c4f into minetest:master Aug 17, 2022
@x2048 x2048 deleted the sun_moon_position branch August 17, 2022 15:23
@x2048 x2048 restored the sun_moon_position branch October 1, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix 🐛 PRs that fix a bug @ Client / Audiovisuals Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements One approval ✅ ◻️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants