bevy/crates/bevy_ui/src/render
patrickariel 3efef59d83
Enable/disable UI anti-aliasing (#15170)
# Objective

Currently, UI is always rendered with anti-aliasing. This makes bevy's
UI completely unsuitable for art-styles that demands hard pixelated
edges, such as retro-style games.

## Solution

Add a component for disabling anti-aliasing in UI.

## Testing

In
[`examples/ui/button.rs`](15e246eff8/examples/ui/button.rs),
add the component to the camera like this:

```rust
use bevy::{prelude::*, ui::prelude::*};

commands.spawn((Camera2dBundle::default(), UiAntiAlias::Off));
```

The rounded button will now render without anti-aliasing.

## Showcase

An example of a rounded UI node rendered without anti-aliasing, with and
without borders:


![image](https://github.com/user-attachments/assets/ea797e40-bdaa-4ede-a0d3-c9a7eab95b6e)
2024-09-16 23:06:23 +00:00
..
mod.rs Enable/disable UI anti-aliasing (#15170) 2024-09-16 23:06:23 +00:00
pipeline.rs Enable/disable UI anti-aliasing (#15170) 2024-09-16 23:06:23 +00:00
render_pass.rs Don't ignore draw errors (#13240) 2024-07-22 19:22:30 +00:00
ui.wgsl Enable/disable UI anti-aliasing (#15170) 2024-09-16 23:06:23 +00:00
ui_material.wgsl Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00
ui_material_pipeline.rs ui material node border calculations fix (#15119) 2024-09-09 22:35:29 +00:00
ui_texture_slice.wgsl UI texture atlas slice shader (#14990) 2024-09-02 23:03:58 +00:00
ui_texture_slice_pipeline.rs Add rect field to UI image (#15095) 2024-09-09 16:16:33 +00:00
ui_vertex_output.wgsl Include UI node size in the vertex inputs for UiMaterial. (#11722) 2024-02-06 16:15:09 +00:00