-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPBGE: Fix screenshot of invalid framebuffer.
Previously the screenshot called from bge.render.makeScreenshoot() were able to copy the framebuffer just after the buffer swap, this behviour was very hazardous. During the swap the driver could do a real swap of back buffer to front buffer or proceed a copy. In the case of copy all is fine, but in the case of the swap the back buffer will be the front buffer of the last frame which will create a one frame delay. The workaround of these issue was to always read from the front buffer but it didn't work with all driver excepted with the configuration of the buildbot. The final fix found is to delay screenshot. Instead doing the screenshot at the exact moment the user called, we push the screenshot data in a stack where all the screen shot are proeceeded at the end of the frame where the back buffer is always valid. The two advantages of doing this are: Always using a valid buffer, have a non-black screenshot for the first frame. The function managing the stack are RAS_ICanvas::AddScreenshot(...) and RAS_ICanvas::FlushScreenshots().
- Loading branch information
1 parent
2b06fad
commit 1538889
Showing
9 changed files
with
65 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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