Skip to content

BACKENDS: OPENGL: Fix rendering issues in 3D games when antialiasing is enabled #6702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 9, 2025

Conversation

lephilousophe
Copy link
Member

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).

This is used when AA is enabled to make sure the engine reads the frame
it just generated instead of the previous one.
In reality they are aliases but GL_DRAW_FRAMEBUFFER_BINDING is not
always defined.
@lephilousophe lephilousophe requested a review from aquadran June 9, 2025 17:03
@bluegr
Copy link
Member

bluegr commented Jun 9, 2025

Nice work, thanks!

@bluegr bluegr merged commit 345345c into scummvm:master Jun 9, 2025
8 checks passed
@lephilousophe lephilousophe deleted the fix-3d-aa branch June 9, 2025 19:25
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.

3 participants