From f514746ecc3bd1c06c7e8ec1f920ddbdaee98fbe Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Tue, 12 Mar 2024 18:19:04 +0100 Subject: [PATCH] use nearest filter --- hui-glium/src/lib.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hui-glium/src/lib.rs b/hui-glium/src/lib.rs index 28a36f0..a33456e 100644 --- a/hui-glium/src/lib.rs +++ b/hui-glium/src/lib.rs @@ -1,13 +1,12 @@ use std::rc::Rc; use glam::Vec2; use glium::{ - Surface, DrawParameters, Blend, - Program, VertexBuffer, IndexBuffer, - backend::{Facade, Context}, - texture::{Texture2d, RawImage2d}, + Blend, DrawParameters, IndexBuffer, Program, Surface, VertexBuffer, + implement_vertex, uniform, + backend::{Context, Facade}, index::PrimitiveType, - implement_vertex, - uniform, uniforms::{Sampler, SamplerBehavior, SamplerWrapFunction}, + texture::{RawImage2d, Texture2d}, + uniforms::{MagnifySamplerFilter, MinifySamplerFilter, Sampler, SamplerBehavior, SamplerWrapFunction}, }; use hui::{ draw::{TextureAtlasMeta, UiDrawCall, UiVertex}, UiInstance @@ -182,6 +181,9 @@ impl GliumUiRenderer { &uniform! { resolution: resolution.to_array(), tex: Sampler(self.ui_texture.as_ref().unwrap(), SamplerBehavior { + max_anisotropy: 1, + magnify_filter: MagnifySamplerFilter::Nearest, + minify_filter: MinifySamplerFilter::NearestMipmapNearest, wrap_function: (SamplerWrapFunction::Clamp, SamplerWrapFunction::Clamp, SamplerWrapFunction::Clamp), ..Default::default() }),