BACKENDS: OPENGL: Fix rendering issues in 3D games when antialiasing is enabled #6702
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.
When 3D backends have been merged, I took the decision to use multisampling FBO to get AA rendering instead of relying on the OpenGL context having it.
This has allowed to add antialiasing to Android and iOS and avoids OpenGL context switches when a new setting is requested.
The main problem it introduces is that now, there are two distinct FBOs: one for reading and one for drawing and some engines expect to read what they just drew without issuing an updateScreen call first (to avoid polluting the display).
This PR adds a new presentBuffer call which does this offscreen rendering letting the engines read back what they have just rendered.
This has been tested with WME (fixing post filters), Grim (fixing save screenshots) and Myst III (fixing transitions).