Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated mesh with custom pipeline is not rendered until next frame #13334

Open
ua-kxie opened this issue May 12, 2024 · 0 comments
Open

updated mesh with custom pipeline is not rendered until next frame #13334

ua-kxie opened this issue May 12, 2024 · 0 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior

Comments

@ua-kxie
Copy link

ua-kxie commented May 12, 2024

Bevy version

0.13.2

If your bug is rendering-related, copy the adapter info that appears when you run Bevy.

AdapterInfo { name: "NVIDIA GeForce RTX 2060 with Max-Q Design", vendor: 4318, device: 7954, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "517.00", backend: Vulkan }

What you did

update mesh with insert_attribute Mesh::ATTRIBUTE_POSITION, to the snapped cursor position on an event that fires when this position changes. Uses a custom pipeline.

What went wrong

After some troubleshooting I've determined that mesh updates with custom pipeline is not rendered until next frame. This usually isn't noticeable, but when combined with grid snapping and events, will always be lagging behind correctly rendered elements.

image
briefly, the red square is a quad which transform is updated to the snapped cursor position. The green triangle has a point in the mesh which is updated to the snapped cursor position. The white line has a point which is updated to do the same, and is rendered through a custom pipeline. Position updates happen upon an event generated when the snapped cursor position changes.

The updated mesh is not drawn until the next event, at which point the newly rendered mesh is outdated. Moving the camera does not rectify the rendered shapes.

Additional information

https://github.com/ua-kxie/circe/tree/bevy-dev

A minimal program reproducing this problem is included as the sole example in this branch (cargo run --example scratch) which was used to produce the screenshot above.

@ua-kxie ua-kxie added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 12, 2024
@james7132 james7132 added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

2 participants