Skip to content

Default Image filtering Nearest causes artifacts #4464

@aevyrie

Description

@aevyrie

What you did

Scaled an image in bevy_egui, resulting in aliasing artifacts. See vladbat00/bevy_egui#89

image

What you expected to happen

I would expect images to default to linear filtering.

What actually happened

Bevy appears to default Images' SamplerDescriptor to Nearest, because it is wgpu's default:

Bevy:

sampler_descriptor: wgpu::SamplerDescriptor::default(),

wgpu SamplerDescriptor:

https://github.com/gfx-rs/wgpu/blob/e4553d7e169a6edf1a4f1b2a983b96700fa098f2/wgpu-core/src/resource.rs#L469-L471

wgpu FilterMode:

https://github.com/gfx-rs/wgpu/blob/988990c24d0933c82cdd661708a3f5bcb4533ea3/wgpu-types/src/lib.rs#L3203

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsA-RenderingDrawing game state to the screenA-UIGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions