bevyengine / bevyengine/bevy

Text Glitching [Rendering Issue]

Open
#8,894 6 comments 0 reactions 0 assignees View on GitHub
A-Rendering A-UI C-Bug D-Straightforward O-Windows S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

Crates:
bevy = "0.10.1"
json = "0.12.4"
regex = "1.8.4"

## \[Optional\] Relevant system information

SystemInfo { os: "Windows 11 Home", kernel: "22621", cpu: "13th Gen Intel(R) Core(TM) i5-13600KF", core_count: "14", memory: "63.9 GiB" }
AdapterInfo { name: "AMD Radeon RX 6700 XT", vendor: 4098, device: 29663, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "23.5.2 (AMD proprietary shader compiler)", backend: Vulkan }

Windows 11 Home (22H2) [22621.1848]
Up-to-date Windows
Up-to-date AMD drivers

## Steps to reproduce

[Link to commit with issue](https://github.com/BoltR6/requiem/tree/a72741214ab6646e8bccadef248ddb4026a03e2e)

## What went wrong
Text is 'glitching' on my Windows machine, as shown in the following screenshot:
![image](https://github.com/bevyengine/bevy/assets/91273156/704a3ea3-2ffd-48f0-b52d-23d0f9b09225)

This issue is NOT reproducible on my NixOS machine, but is reproducible on both of my Windows 11 machines (possibly of note: both are using AMD cards).
It's not an issue with my text files, I tested some basic ones. The pattern of glitching is the exact same each startup, regardless of window position or size. Changing the position or scale of the text will result in the pattern changing, so I suspect this is a rendering issue.

The text object is generated per The Book's example:
```
commands.spawn((
GUIScrollText {
id: String::from("text_ui")
},
TextBundle::from_section(
"Nayu_todo",
TextStyle {
font: asset_server.load("fonts/ALLER.ttf"),
font_size: 100.0,
color: Color::WHITE,
},
).with_text_alignment(TextAlignment::Left)
.with_style(Style {
position_type: PositionType::Absolute,
position: UiRect {
bottom: Val::Px(215.0),
left: Val::Px(335.0),
..default()
},
..default()
})
));
```

It's brought in via a startup system with the following setup:
```
pub struct ChatController;
impl Plugin for ChatController {
fn build(&self, app: &mut App){
app.add_startup_system(import_gui_sprites)
.add_startup_system(spawn_chatbox);
}
}
fn import_gui_sprites( mut game_state: ResMut, asset_server: Res ){
```

And finally, the plugin is dropped into the main app:
```
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
title: String::from("Ettethread - Requiem"),
resolution: (1280., 800.).into(),
present_mode: PresentMode::AutoVsync,
// Tells wasm to resize the window according to the available canvas
fit_canvas_to_parent: true,
// Tells wasm not to override default event handling, like F5, Ctrl+R etc.
prevent_default_event_handling: false,
..default()
}),
..default()
}))
.init_resource::()
.add_startup_system(setup)
.add_plugin(Compiler)
.add_plugin(BackgroundController)
.add_plugin(CharacterController)
.add_plugin(ChatController)
.run();
}
```

Contributor guide

Open the contributing guide

Research direction

Start by building and running the linked commit on Windows 11 with the reported AMD Vulkan setup, then compare its text rendering with the NixOS result. Use the provided TextBundle and startup/plugin setup as the reproduction path; done means the text renders without the reported glitching on the affected configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.