bevyengine / bevyengine/bevy

Clipping and Distortion on UI Images with Transforms

Open
#5,294 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering A-UI C-Bug
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

0.7

## Relevant system information

```ignore
AdapterInfo { name: "NVIDIA GeForce RTX 3070", vendor: 4318, device: 9348, device_type: DiscreteGpu, backend: Vulkan }
```

## What you did

```rust
commands.spawn_bundle(UiCameraBundle::default());
commands.spawn_bundle(ImageBundle {
style: Style {
size: Size::new(Val::Px(500.0), Val::Px(500.0)),
..default()
},
image: asset_server.load("branding/bevy_logo_dark_big.png").into(),
transform: Transform::from_rotation(Quat::from_rotation_x(1.0)),
..default()
});
```

## What went wrong

The UI image renders with clipping, or if rotated around other axes, with distortion.

## Additional information

`transform: Transform::from_rotation(Quat::from_rotation_x(1.0)),`
![image](https://user-images.githubusercontent.com/5150427/178401803-533eaea5-b42e-45e4-9e5c-9a686927da15.png)

`transform: Transform::from_rotation(Quat::from_rotation_y(1.0)),`
![image](https://user-images.githubusercontent.com/5150427/178401774-ae901174-18f0-46cd-ab9f-69578070923d.png)

`transform: Transform::from_rotation(Quat::from_rotation_z(1.0)),`
![image](https://user-images.githubusercontent.com/5150427/178401861-df3807c0-714a-4584-b040-85ce8893aa41.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.