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

Decouple texture interpolation method from the output backend names #3627

Open
johnnovak opened this issue Apr 21, 2024 · 0 comments
Open

Decouple texture interpolation method from the output backend names #3627

johnnovak opened this issue Apr 21, 2024 · 0 comments
Labels
SDL SDL integration related issues shaders Issues related to shaders video Graphics and video related issues

Comments

@johnnovak
Copy link
Member

Conflating the interpolation method into the rendering backend's name is rather unfortunate, sloppy, and ultimately, incorrect. We've been intending to decouple these years ago, but somehow, it never happened.

Now we have these:

  • opengl – OpenGL + bilinear interpolation
  • openglnb – OpenGL + nearest-neighbour interpolation
  • texture – SDL's abstract "texture" backend + bilinear interpolation
  • texturenb – SDL's abstract "texture" backend + nearest-neighbour interpolation

What I think we should do instead:

  1. output should only specify the backend: opengl or texture.

  2. The OpenGL backend is shader-based; you always have a shader active, even if you don't specify one with glshader. That's just how modern OpenGL works. The default shader is the none shader which uses bilinear interpolation.

    If we really wanted to provide a nearest-neighbour OpenGL mode, we should introduce a new nearest shader, and possibly alias none to bilinear as well. Then you could do this:

    [sdl] 
    output = opengl
    
    [render]
    # for bilinear:
    glshader = none 
    # or
    glshader = bilinear
    
    # for nearest-neighbour:
    glshader = nearest
  3. The texture backend we use as a fallback for systems that are not OpenGL-capable (I would think there are not many out there, but that's a different topic), it makes sense to add a texture_interpolation setting with the bilinear and nearest options. Note we already have a texture_renderer setting, so the name of this new setting would be consistent with that.

This is all a rather low-risk change and could go in before the move to SDL3.

@johnnovak johnnovak added video Graphics and video related issues shaders Issues related to shaders SDL SDL integration related issues labels Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDL SDL integration related issues shaders Issues related to shaders video Graphics and video related issues
Projects
None yet
Development

No branches or pull requests

1 participant