use linear for min

This commit is contained in:
griffi-gh 2024-05-06 17:38:58 +02:00
parent 99cc2d1e72
commit 811bd8d8b4
2 changed files with 4 additions and 4 deletions

View file

@ -40,7 +40,7 @@ var s_diffuse: sampler;
@fragment
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
let color: vec4<f32> = textureSample(t_diffuse, s_diffuse, in.uv, in.tex_index);
if (color.a == 0.) {
if (color.a < 0.5) {
discard;
}
return color;

View file

@ -70,7 +70,7 @@ pub fn load_prefabs(
address_mode_v: wgpu::AddressMode::ClampToEdge,
address_mode_w: wgpu::AddressMode::ClampToEdge,
mag_filter: wgpu::FilterMode::Nearest,
min_filter: wgpu::FilterMode::Nearest, //TODO min_filter Linear, requires filtering sampler
min_filter: wgpu::FilterMode::Linear,
mipmap_filter: wgpu::FilterMode::Nearest,
..Default::default()
});
@ -82,7 +82,7 @@ pub fn load_prefabs(
binding: 0,
visibility: wgpu::ShaderStages::FRAGMENT,
ty: wgpu::BindingType::Texture {
sample_type: wgpu::TextureSampleType::Float { filterable: false },
sample_type: wgpu::TextureSampleType::Float { filterable: true },
view_dimension: wgpu::TextureViewDimension::D2Array,
multisampled: false,
},
@ -91,7 +91,7 @@ pub fn load_prefabs(
wgpu::BindGroupLayoutEntry {
binding: 1,
visibility: wgpu::ShaderStages::FRAGMENT,
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::NonFiltering),
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering),
count: None,
}
]