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

Quantize light frustum calculations #12357

Merged
merged 2 commits into from
May 23, 2022
Merged

Conversation

x2048
Copy link
Contributor

@x2048 x2048 commented May 19, 2022

Reduces dancing shadows.

Quantization is applied to three variables:

  • Camera/player position is truncated to 2-node increments
  • Player camera direction is truncated to increments of 15 degrees in Yaw and Pitch
  • Light direction is truncated to increments of 0.0625 degrees (approximate angle that sun travels in 15 seconds)

While reducing dancing of the shadows on the grass and tree leaves, the movement of the shadows becomes chunky.

To do

This PR is Ready for Review.

How to test

  1. Enable shadows
  2. Disable filters or reduce filters
  3. Start game
  4. Walk and look around, observe less dancing shadows
  5. Pause time (set time speed to 0)
  6. Walk and look around, there should be almost no dancing shadows.

@lhofhansl @kilbith You use shadows frequently, you feedback is appreciated
@Andrey2470T It might resolve #11743

@x2048 x2048 added @ Client / Audiovisuals Discussion Issues meant for discussion of one or more proposals labels May 19, 2022
@lhofhansl
Copy link
Contributor

Yeah. The jittering is reduced a lot!
Code looks good.

@rubenwardy rubenwardy added the Roadmap The change matches an item on the current roadmap label May 23, 2022
@x2048 x2048 merged commit ed26ed5 into minetest:master May 23, 2022
@x2048 x2048 deleted the shadow_flicker branch May 23, 2022 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client / Audiovisuals Discussion Issues meant for discussion of one or more proposals One approval ✅ ◻️ Roadmap The change matches an item on the current roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shadows are waving along the edges when moving.
3 participants