Repository navigation
Conversation
D3D11Host only rendered when 16 ms had passed since the last drawn frame. WPF raises CompositionTarget.Rendering once per display refresh, not at a fixed 60 Hz, and a skipped tick's time isn't carried over, so any refresh period that doesn't divide 16 ms dropped whole frames: 75 Hz drew 37 FPS, 100 Hz 50 and 144 Hz 48. TargetElapsedTime now defaults to zero. FrameRateTests fails on the old default at 75, 100 and 144 Hz.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hey, small one. on a 75, 100 or 144 Hz screen the 3D viewport runs at 37, 50 or 48 FPS, so slower than on a 60 Hz screen
D3D11Hostonly draws when 16 ms have passed since the last drawn frame. WPF raisesCompositionTarget.Renderingonce per display refresh though, not at a fixed 60 Hz, and the time of a skipped tick isn't carried over. so whenever the refresh period doesn't divide 16 ms, ticks get dropped: at 75 Hz they're 13.3 ms apart, so only every second one gets throughTargetElapsedTimenow defaults to zero, so it draws on every WPF frame. the property is still there if something wants a cap. the two comments saying WPF is limited to 60 FPS are updated toofiles
GameWorld.Core/WpfWindow/D3D11Host.cs: the default, plus the check pulled out intoIsFrameDueso it can be testedGameWorld.Core/WpfWindow/WpfGame.cs: comment onlyGameWorld.CoreTest/Rendering/FrameRateTests.cs: newtesting
FrameRateTestscounts the frames drawn in one simulated second at 60, 75, 100 and 144 Hz. with the old 16 ms default it fails at 75 (37 drawn), 100 (50) and 144 (48), with the new default all four passGameWorld.CoreTest: 570 passed, 0 failedAssetEditor.csprojthe waypr-test.ymldoes, 0 errorsit's been in my fork since October