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

How to set texture filter parameters? #1980

Open
pvini07BR opened this issue Dec 29, 2021 · 2 comments
Open

How to set texture filter parameters? #1980

pvini07BR opened this issue Dec 29, 2021 · 2 comments

Comments

@pvini07BR
Copy link

pvini07BR commented Dec 29, 2021

You can set the texture parameters with the glTexParameteri() function, but I cant find a replacement for it in glium anywhere. It seems like the textures are set to be on GL_LINEAR by default, but I want to change it to be GL_NEAREST. Is there how to do that? Or is it not implemented yet? Am I missing something? I'm new to OpenGL, though.

@FliegendeWurst
Copy link

You can modify the filter functions like this:

glium::uniforms::Sampler::new(&texture)
  .minify_filter(glium::uniforms::MinifySamplerFilter::Nearest)
  .magnify_filter(glium::uniforms::MagnifySamplerFilter::Nearest),

@alphaqu
Copy link

alphaqu commented Apr 12, 2022

That does not work on SrgbTextures. It seems to be hardcoded on what type of texture it is in texture::any::new_texture

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

No branches or pull requests

3 participants