Text2dShadow sometimes renders in front of its text
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
Start by reproducing the provided example in the Bevy 2D text rendering pipeline, focusing on Text2dShadow, AlphaMode2d, and the RenderSystems::Queue ordering described in the workaround. Locate where shadow and text draw commands are queued and compare their ordering when an unrelated mesh changes visibility. Done means the reproduction consistently renders the shadow behind the text across the affected platform or build configurations without relying on the workaround.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bevy version and features
- Bevy 0.20.1
- Bevy 5c485c424 (latest main)
Default features
What you did
Repeatedly include/exclude another (unrelated) mesh from rendering. Visibility::Hidden works, but for some reason moving it out of view produces more noticeable effects.
use bevy::{prelude::*, sprite::Text2dShadow, sprite_render::AlphaMode2d};
fn main() {
App::new()
.insert_resource(ClearColor(Color::WHITE))
.add_plugins(DefaultPlugins)
.add_systems(Startup, startup)
.add_systems(Update, update)
.run();
}
fn startup(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<ColorMaterial>>,
) {
commands.spawn(Camera2d);
commands.spawn((
Text2d::new("Red text with blue shadow"),
TextColor(Color::srgba(1.0, 0.0, 0.0, 1.0)),
TextFont::from_font_size(64.0),
Text2dShadow {
color: Color::srgba(0.0, 0.0, 1.0, 1.0),
offset: Vec2::ZERO,
},
));
commands.spawn((
Mesh2d(meshes.add(Rectangle::new(64.0, 64.0))),
MeshMaterial2d(materials.add(ColorMaterial {
color: Color::srgba(0.9, 0.9, 0.9, 1.0),
alpha_mode: AlphaMode2d::Blend, // this matters
..Default::default()
})),
Transform::from_xyz(0.0, 96.0, 0.0),
));
}
fn update(time: Res<Time>, mut mesh_transform: Single<&mut Transform, With<Mesh2d>>) {
**mesh_transform = if (time.elapsed().as_millis() / 250) % 2 == 0 {
// Move the rectangle out of frame.
// `Visibility::Hidden` also works but seems to only flicker briefly.
Transform::from_xyz(0.0, 99999.0, 0.0)
} else {
Transform::from_xyz(0.0, 96.0, 0.0)
};
}
This seems to be systems-ordering dependent, so it may not always be easy to reproduce. If the above works as expected, perhaps try a web build.
What went wrong
The blue text shadow sometimes renders in front of the red text, meaning its drawn later.
Additional information
Workaround:
impl Plugin for RenderingPlugin {
fn build(&self, app: &mut App) {
if let Some(render_app) = app.get_sub_app_mut(RenderApp) {
render_app.add_systems(
Render,
(|| {})
.in_set(RenderSystems::Queue)
.after(queue_material2d_meshes)
.before(queue_sprites),
);
}
}
}
- Lingua principale
- Rust
- Stelle
- 50k
- Fork
- 5.1k
- Merge medio
- 2g 20h
- PR unite (30g)
- 129
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bevyengine/bevy
-
C-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bevyengine/bevy#26718 ·
I maintainer di solito rispondono entro 2 giorni
-
C-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bevyengine/bevy#26689 ·
I maintainer di solito rispondono entro 2 giorni
-
Volumetric fog: a `FogVolume` with `Visibility::Hidden` is still renderedForse già presa @adityawrk l’ha presa 2 giorni fa. ApertaC-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
bevyengine/bevy#26688 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
bevyengine/bevy#26684 ·
I maintainer di solito rispondono entro 2 giorni
-
Create a bevy_fuzzy exampleForse già presa @Tatsuya0330 l’ha presa 1 giorno fa. ApertaA-UI C-Examples C-Feature D-Straightforward S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy#26676 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di bevyengine/bevy
Issue simili
-
area:ui effort:medium enhancement P7 source:agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
marketing
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
machine rename accepts a label already used by another machine, making --machine <label> ambiguousApertamaintainer-needed p2 remote triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug help wanted ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
userFRM/egui-charts#4605 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno