Skip to content

Conversation

@FrogTheFrog
Copy link
Contributor

@FrogTheFrog FrogTheFrog commented Apr 11, 2023

Description

This change makes use of the IDXGIOutputDuplication::AcquireNextFrame to wait for next frames instead of using additional sleep-based framelimiter.

Additionally, a new framelimiter has been introduced to work with the IDXGIOutputDuplication::AcquireNextFrame to skip the frames when we actually need to (when streaming at lower FPS than what is being rendered).

More details

I have been chasing random "jumpy camera movement" for months. The problem is how random it all is.
You can have a very smooth framerate:
image

and then out of nowhere it just starts jerking (going into the game menu makes it go away, until it comes back):
image

It's not always noticeable, until the camera starts jumping. By jumping I mean stuttering, but in a very uniform manner, as if the FPS has dropped to 20 FPS or something.

I have managed to procure a 3 minute test run in Cyberpunk 2077, at the end of which the jerkiness occurs. I then have managed to track it down to the additional sleep/wait that is being done before the AcquireNextFrame is called. Once removed, the AcquireNextFrame does the waiting. Since then, I have yet to experience that uni-formally jumpy camera action.

So, I have removed the wait/sleep code block and introduced another framelimiter that kicks in if stream FPS < render FPS.

Overall the frametime seems to have improved a little in heavy-load games. Take Hogwarts Legacy for example (here I am standing in the same place and spinning around).

BEFORE:
image
image

AFTER:
image
image

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

@FrogTheFrog FrogTheFrog closed this by deleting the head repository May 30, 2023
@ReenigneArcher
Copy link
Member

Was this closed intentionally?

@FrogTheFrog
Copy link
Contributor Author

Was this closed intentionally?

Yes and no. I have deleted my repo since I wanted a fresh start :/

@FrogTheFrog
Copy link
Contributor Author

It was not going to be merged, but stayed as a draft for a reference only, so there shouldn't be a problem.

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.

2 participants