use nearest filter

This commit is contained in:
griffi-gh 2024-03-12 18:19:04 +01:00
parent d43fd91a4e
commit 4437eb9878

View file

@ -1,13 +1,12 @@
use std::rc::Rc; use std::rc::Rc;
use glam::Vec2; use glam::Vec2;
use glium::{ use glium::{
Surface, DrawParameters, Blend, Blend, DrawParameters, IndexBuffer, Program, Surface, VertexBuffer,
Program, VertexBuffer, IndexBuffer, implement_vertex, uniform,
backend::{Facade, Context}, backend::{Context, Facade},
texture::{Texture2d, RawImage2d},
index::PrimitiveType, index::PrimitiveType,
implement_vertex, texture::{RawImage2d, Texture2d},
uniform, uniforms::{Sampler, SamplerBehavior, SamplerWrapFunction}, uniforms::{MagnifySamplerFilter, MinifySamplerFilter, Sampler, SamplerBehavior, SamplerWrapFunction},
}; };
use hui::{ use hui::{
draw::{TextureAtlasMeta, UiDrawCall, UiVertex}, UiInstance draw::{TextureAtlasMeta, UiDrawCall, UiVertex}, UiInstance
@ -182,6 +181,9 @@ impl GliumUiRenderer {
&uniform! { &uniform! {
resolution: resolution.to_array(), resolution: resolution.to_array(),
tex: Sampler(self.ui_texture.as_ref().unwrap(), SamplerBehavior { 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), wrap_function: (SamplerWrapFunction::Clamp, SamplerWrapFunction::Clamp, SamplerWrapFunction::Clamp),
..Default::default() ..Default::default()
}), }),