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

Need support for GL_CLAMP_TO_BORDER #1837

Open
JonathSpirit opened this issue Oct 23, 2021 · 2 comments
Open

Need support for GL_CLAMP_TO_BORDER #1837

JonathSpirit opened this issue Oct 23, 2021 · 2 comments

Comments

@JonathSpirit
Copy link

Subject of the issue

When dealing with polygon that are more larger than the actual texture, the default behaviour of SFML is to clamp pixels to the edge.
This is not ideal if you work on a method with light and a visibility polygon for example.

More information here :
image
https://learnopengl.com/Getting-started/Textures

I think this can be an great addition on the texture class.

@AlexGarrity
Copy link

AlexGarrity commented Nov 12, 2021

I'm not a GL expert but I've had a quick look through the GL docs and extension registry, and I don't believe this feature can be implementedwithout bumping the OpenGL ES version. The required extensions - GL_EXT_texture_border_clamp, GL_OES_texture_border_clamp, or GL_NV_texture_border_clamp - were added with GL ES 3.0.

Provided that you're only supporting GL 1.0+ and GL ES 3.0+, it's very much possible to implement this behaviour yourself by mixing SFML with OpenGL code (albeit you would likely have to generate a custom glad/gl.h file) but I don't believe this is something that can be implemented in SFML whilst legacy hardware support is trying to be maintained

@JonathSpirit
Copy link
Author

I think we can provide a method to enable GL_CLAMP_TO_BORDER and check if the extension is available. We can simply return a boolean to notice the user if the feature have been correctly added.

it's very much possible to implement this behaviour yourself by mixing SFML with OpenGL code

I mean yes, but SFML is made for simplicity and providing some great feature like this easily is pretty cool especially if you are a beginner (although I'm not sure a beginner will use this :) ).

Provided that you're only supporting GL 1.0+ and GL ES 3.0+

I'm pretty sure that a majority of system (maybe not with ES) have that feature available today. Like I say up there, if the feature is not here, just simply ignore the change and provide the user a negative response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants