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

improves paging preloader #3126

Merged
merged 23 commits into from
Sep 27, 2021
Merged

Conversation

bosvensson1
Copy link
Contributor

Currently, Open MW's paging preloader uses an inflexible strategy based around predicted player movement one second into the future. Relying solely on this predicted movement leads to cache misses when the player's movement vector changes unexpectedly. Further, the possible discrepancy between a player's position versus the camera's position is not accounted for. Last but not least, major issues arise with large object paging chunks in the distance that we are unable to prepare within the allotted time.

This PR proposes a more flexible strategy allowing us to preload chunks in all directions.

Summary of changes:

  • Preloads chunks in all directions according to a defined distance modifier given to LodCallback.
  • Speeds up chunk creation in chunkmanager.cpp by trying to reuse data from an existing similar chunk of differing lodFlags.
  • Removes asynchronous high-level view updates prepared by storeViews. This approach provided negligible benefits and caused several issues such as groundcover pop-in noticed by @akortunov. Removes the previously used workaround for groundcover pop-in.
  • Uses a more sensible movement threshold for launching new preloading tasks in cellpreloader.cpp.

Requesting review from @elsid who provided excellent feedback on my last PR related to preloading.

@AnyOldName3
Copy link
Member

I'm not an expert on our preloading system by any means, so I can't review that aspect, but I see quite a few places with some questionable whitespace deicisions.

@psi29a psi29a merged commit 01cc610 into OpenMW:master Sep 27, 2021
@psi29a
Copy link
Member

psi29a commented Sep 27, 2021

I removed the reference to mDebugChunks in this PR after merging in !3127

@glassmancody
Copy link
Contributor

This has broken enable/disable commands in active grid.

https://gitlab.com/OpenMW/openmw/-/issues/6350

@bosvensson1
Copy link
Contributor Author

@glassmancody somehow I have failed to recreate your instructions, but I have noticed a potential issue in my changes. They might interfere with an optimisation that was not well documented. Could you please give https://github.com/bosvensson1/openmw/tree/patch-57 a try?

@bosvensson1
Copy link
Contributor Author

@glassmancody I had already noticed "Particle offset incorrect in character preview". Such an issue may have been caused by my first PR to Open MW. My latest PR #3183 should resolve such particle issues as a side effect.

@glassmancody
Copy link
Contributor

Splendid, I tried both out and they both fix their respective issues 😄

@psi29a
Copy link
Member

psi29a commented Oct 23, 2021

@psi29a psi29a mentioned this pull request Oct 23, 2021
@bosvensson1
Copy link
Contributor Author

@glassmancody I have a question concerning your @simpleLighting proposal. Could we avoid the new shader path by just setting @endLight to 1? I am asking because the next version of my shadows bin PR will have to touch our object shaders in the vicinity of @simpleLighting changes.

@glassmancody
Copy link
Contributor

@bosvensson1 Good idea, I've just pushed new change to get rid of object shaders path.

@glassmancody
Copy link
Contributor

I should say, we really need a better way to communicate about specific issues. Poor paging preloader is getting overloaded with a bunch of unrelated information.

@akortunov
Copy link
Collaborator

Removes asynchronous high-level view updates prepared by storeViews. This approach provided negligible benefits and caused several issues such as groundcover pop-in noticed by akortunov. Removes the previously used workaround for groundcover pop-in.

Unfortunately, new workaround from this PR does not work, so pop-ins are back again.

@akortunov akortunov mentioned this pull request Nov 2, 2021
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.

6 participants