Merged
Conversation
Doctoror
commented
Feb 10, 2024
| class OpenGLES2Engine extends Everchanging.GLEngine { | ||
|
|
||
| @Override | ||
| public void onSurfaceCreated(SurfaceHolder surfaceHolder) { |
Contributor
Author
There was a problem hiding this comment.
This method was moved below, not removed. Remains unchanged.
26eff3c to
c67cfc3
Compare
To avoid race conditions we must schedule next frame only after previous frame has finished rendering. Otherwise, if you try to schedule faster then it can draw you will get render freezes. This happened when I tried to schedule butterflies at 60 FPS on Emulator. The service was requesting render sooner than old renderings could finish and there was a visible delay of a few seconds for render thread to catch up. The other problem this solves is inconsistent FPS. If any frame took longer to render it will be accounted for when scheduling next frame.
c67cfc3 to
b962765
Compare
Owner
|
Great idea |
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.
To avoid race conditions we must schedule next frame only after previous frame has finished rendering. Otherwise, if you try to schedule faster then it can draw you will get render freezes. This happened when I tried to schedule butterflies at 60 FPS on Emulator. The service was requesting render sooner than old renderings could finish and there was a visible delay of a few seconds for render thread to catch up.
The other problem this solves is inconsistent FPS. If any frame took longer to render it will be accounted for when scheduling next frame.