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

Implement mapblock camera offset correctly #10702

Merged
merged 5 commits into from
Dec 5, 2020

Conversation

hecktest
Copy link
Contributor

@hecktest hecktest commented Dec 5, 2020

bugfix, rendering, performance, maintenance, trivial
The camera offset for mapblocks was originally implemented in a really stupid way, see #10683 (comment)

This PR reimplements it as a matrix transformation instead of translating every damn vertex in software.
I also moved a couple struct types to the header where they belong.

How to test
Zip around the map with fly/fast to trigger the camera offset repeatedly. Enjoy reduced mesher stutter.
Teleport to the map's edge to verify that nothing is jittery.

@sfan5 sfan5 added @ Client rendering Bugfix 🐛 PRs that fix a bug Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements Performance labels Dec 5, 2020
src/client/clientmap.cpp Outdated Show resolved Hide resolved
src/client/clientmap.cpp Outdated Show resolved Hide resolved
@lhofhansl
Copy link
Contributor

Looks good... Tested... Works....

Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

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

Tested, does indeed work

@lhofhansl lhofhansl merged commit 6d7067f into minetest:master Dec 5, 2020
@SmallJoker
Copy link
Member

No behaviour change for attachments either. Works well.

HybridDog pushed a commit to HybridDog/minetest that referenced this pull request Dec 17, 2020
Implement mapblock camera offset correctly - reduce client jitter

Co-authored-by: hecktest <>
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 rendering Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements Performance >= Two approvals ✅ ✅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants