Skip to content

Conversation

@pchote
Copy link
Member

@pchote pchote commented Oct 29, 2024

Fixes the issue mentioned in #21631 (comment). See #17424 (comment) for the original discussion - my version of the fix is correct for sprites rendered at 1:1 scale, but fails when we want to render them at a large magnification. We now have a mechanism to require GLES extensions which is now used also for the derivatives.

Testcase: Change ActorPreviewWidget's GetScale method to return 10f and check the lobby colour picker.

Before:
Screenshot 2024-10-29 at 21 33 10

After:
Screenshot 2024-10-29 at 21 53 13

This fixes rendering artifacts when sprites are scaled > 1.
@pchote pchote added this to the Next Release milestone Oct 29, 2024
var hasBGRA = SDL.SDL_GL_ExtensionSupported("GL_EXT_texture_format_BGRA8888") == SDL.SDL_bool.SDL_TRUE;
if (Version.Contains(" ES") && hasBGRA && major >= 3)
var hasDerivatives = SDL.SDL_GL_ExtensionSupported("GL_OES_standard_derivatives") == SDL.SDL_bool.SDL_TRUE;
if (Version.Contains(" ES") && hasBGRA && hasDerivatives && major >= 3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does OpenRA even run on OpenGL ES?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, and this is actually the default on Windows (ANGLE provides a GLES implementation built on top of Direct X).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested that the GLES changes work correctly on both Linux (native) and Windows (ANGLE).

Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that LGTM

@PunkPun PunkPun merged commit 09063d2 into OpenRA:bleed Nov 3, 2024
@PunkPun
Copy link
Member

PunkPun commented Nov 3, 2024

changelog

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.

2 participants