Skip to content
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

OpenGL: use GL_CLAMP_TO_EDGE with Linear filter #2315

Merged

Conversation

ivan-mogilko
Copy link
Contributor

@ivan-mogilko ivan-mogilko commented Jan 26, 2024

This supposedly fixes occasional edge lines around sprites, occurring in "render in screen resolution" mode with Linear filter, and certain scaling factors.

A quote from Khronos specs, about a difference between GL_CLAMP and GL_CLAMP_TO_EDGE :

GL normally clamps such that the texture coordinates are limited to exactly the range [0;1]. When a texture coordinate is clamped using this algorithm, the texture sampling filter straddles the edge of the texture image, taking half its sample values from within the texture image, and the other half from the texture border. It is sometimes desirable to clamp a texture without requiring a border, and without using the constant border color.

<...> CLAMP_TO_EDGE, clamps texture coordinates at all mipmap levels such that the texture filter never samples a border texel. The color returned when clamping is derived only from texels at the edge of the texture image.

This supposedly fixes occasional edge lines around sprites, occurring in "render in screen resolution" mode with Linear filter.
@ivan-mogilko ivan-mogilko merged commit 12b7f62 into adventuregamestudio:master Jan 30, 2024
20 checks passed
@ivan-mogilko
Copy link
Contributor Author

User confirmed that this fixes the problem.

@ivan-mogilko ivan-mogilko deleted the 361--fix-gl-linear-clamp branch January 30, 2024 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant