bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.25k stars 3.47k forks source link

Gizmos circle_2d does not appear for the first few times it is requested after bevy startup #14701

Open recatek opened 1 month ago

recatek commented 1 month ago

Bevy version

v0.14.1

What you did

Called gizmos.circle_2d and auto-captured screenshots for every frame for debugging a timing issue.

What went wrong

The circle_2d command (and potentially others, I only tried the one) did not draw for the first few frames I requested it. It looks like there is some sort of async initialization delay. If you warm start the gizmo by drawing an invisible circle_2d in a zero-alpha color immediately upon running, before requesting a circle in earnest, this problem seems to go away.

Without gizmo warm start:

badcircle

With gizmo warm start:

goodcircle

rparrett commented 1 month ago

Could you try with synchronous_pipeline_compilation enabled?

If that fixes the issue but is unacceptable, you can check the status of pipelines in the pipeline cache and use that to create a loading state. https://github.com/rparrett/bevy_pipelines_ready is a simple implementation of that pattern.

See also: https://github.com/bevyengine/bevy/issues/10871