How do I set a sample to non-filtering? #7592
-
I'm loading an HDRi that is crashing in WASM (for some reason not in native tho). It's the one from @griffin#2864 's tutorial: https://github.com/DGriffin91/bevy_glowy_orb_tutorial/blob/main/assets/textures/stone_alley_02_1k.hdr #[derive(AsBindGroup, Debug, Clone, TypeUuid)]
#[uuid = "bd5c76fd-6fdd-4de4-9744-4e8beea8daaf"]
pub struct GlowyMaterial {
#[texture(0, filterable = false)]
#[sampler(1, sampler_type = "non_filtering")]
pub env_texture: Option<Handle<Image>>,
} but apparently not, since at runtime I get:
This leads me to believe that the attributes I set are more descriptive than prescriptive. How can I tell Bevy to actually use a sampler without filtering? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Mirroring the discord discussion here for googleability: Griffin — Today at 5:20 AM fn bind_group_layout(render_device: &renderer::RenderDevice) -> BindGroupLayout {
render_device.create_bind_group_layout(&BindGroupLayoutDescriptor {
entries: &[
BindGroupLayoutEntry {
binding: 0u32,
visibility: ShaderStages::VERTEX | ShaderStages::FRAGMENT,
ty: BindingType::Texture {
multisampled: false,
sample_type: TextureSampleType::Float { filterable: false },
view_dimension: TextureViewDimension::D2,
},
count: None,
},
BindGroupLayoutEntry {
binding: 1u32,
visibility: ShaderStages::VERTEX | ShaderStages::FRAGMENT,
ty: BindingType::Sampler(SamplerBindingType::NonFiltering),
count: None,
},
],
label: None,
})
} Which seems to imply we tell wgpu to use NonFiltering. IceSentry — Today at 6:17 AM Griffin — Today at 6:29 AM hohenheim hohenheim Griffin — Today at 8:12 PM hohenheim Griffin — Today at 8:14 PM hohenheim Griffin — Today at 8:17 PM cwfitzgerald — Today at 8:21 PM |
Beta Was this translation helpful? Give feedback.
Mirroring the discord discussion here for googleability:
Griffin — Today at 5:20 AM
The AsBindGroup macro you have expands to: