{"id":15017975,"url":"https://github.com/aevyrie/bevy_framepace","last_synced_at":"2025-05-14T14:10:15.687Z","repository":{"id":37332999,"uuid":"445370803","full_name":"aevyrie/bevy_framepace","owner":"aevyrie","description":"Framepacing and framelimiting for Bevy","archived":false,"fork":false,"pushed_at":"2025-04-26T07:23:12.000Z","size":432,"stargazers_count":280,"open_issues_count":7,"forks_count":26,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-08T16:21:56.381Z","etag":null,"topics":["bevy","bevy-plugin","graphics"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/bevy_framepace","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aevyrie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"aevyrie"}},"created_at":"2022-01-07T02:14:46.000Z","updated_at":"2025-05-08T13:08:26.000Z","dependencies_parsed_at":"2023-02-15T12:01:43.278Z","dependency_job_id":"b353af4d-ea04-415d-b115-a810f1b92b84","html_url":"https://github.com/aevyrie/bevy_framepace","commit_stats":{"total_commits":129,"total_committers":8,"mean_commits":16.125,"dds":0.06976744186046513,"last_synced_commit":"c705111332c642863a1d9545312ca43d740d4dc8"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aevyrie%2Fbevy_framepace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aevyrie%2Fbevy_framepace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aevyrie%2Fbevy_framepace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aevyrie%2Fbevy_framepace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aevyrie","download_url":"https://codeload.github.com/aevyrie/bevy_framepace/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254160557,"owners_count":22024571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bevy","bevy-plugin","graphics"],"created_at":"2024-09-24T19:51:16.473Z","updated_at":"2025-05-14T14:10:10.665Z","avatar_url":"https://github.com/aevyrie.png","language":"Rust","funding_links":["https://github.com/sponsors/aevyrie"],"categories":["Misc"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\r\n\r\n# bevy_framepace⏱️\r\n\r\n**Framepacing and framelimiting for Bevy**\r\n\r\n[![crates.io](https://img.shields.io/crates/v/bevy_framepace)](https://crates.io/crates/bevy_framepace)\r\n[![docs.rs](https://docs.rs/bevy_framepace/badge.svg)](https://docs.rs/bevy_framepace)\r\n[![CI](https://github.com/aevyrie/bevy_framepace/workflows/CI/badge.svg?branch=main)](https://github.com/aevyrie/bevy_framepace/actions?query=workflow%3A%22CI%22+branch%3Amain)\r\n[![Bevy](https://img.shields.io/badge/Bevy%20tracking-main-lightblue)](https://github.com/bevyengine/bevy/blob/main/docs/plugins_guidelines.md#main-branch-tracking)\r\n\r\n\u003cvideo src = \"https://user-images.githubusercontent.com/2632925/211992979-1892195b-b98f-424e-ae91-3fc4d6924b5e.mp4\"\u003e\u003c/video\u003e\r\n\r\n\u003c/div\u003e\r\n\r\n### Usage\r\n\r\nIt's as simple as adding the plugin to your app:\r\n\r\n```rs\r\napp.add_plugins(bevy_framepace::FramepacePlugin);\r\n```\r\n\r\nBy default, the plugin will automatically measure your framerate and use this for framepacing.\r\n\r\nYou can adjust the framerate limit at runtime by modifying the`FramepaceSettings` resource. For\r\nexample, to set the framerate limit to 30fps:\r\n\r\n```rs\r\nsettings.limiter = Limiter::from_framerate(30.0),\r\n```\r\n\r\nSee `demo.rs` in the examples folder, or run with:\r\n\r\n```console\r\ncargo run --release --example demo\r\n```\r\n\r\n## How it works\r\n\r\nThe plugin works by recording how long it takes to render each frame, and sleeping the main thread\r\nuntil the desired frametime is reached. This ensures the next frame isn't started until the very\r\nlast moment, delaying the event loop from restarting. By delaying the event loop, and thus input\r\ncollection, this reduces motion-to-photon latency by moving reading input closer to  rendering the\r\nframe.\r\n\r\nThe `spin_sleep` dependency is needed for precise sleep times. The sleep function in the standard\r\nlibrary is not accurate enough for this application, especially on Windows.\r\n\r\n## Bevy Version Support\r\n\r\nI intend to track the `main` branch of Bevy. PRs supporting this are welcome!\r\n\r\n| bevy | bevy_framepace            |\r\n| ---- | -------------------       |\r\n| 0.15 | 0.18                      |\r\n| 0.14 | 0.17                      |\r\n| 0.13 | 0.15, 0.16                |\r\n| 0.12 | 0.14                      |\r\n| 0.11 | 0.13                      |\r\n| 0.10 | 0.12                      |\r\n| 0.9  | 0.7, 0.8, 0.9, 0.10, 0.11 |\r\n| 0.8  | 0.5, 0.6                  |\r\n| 0.7  | 0.4                       |\r\n| 0.6  | 0.3                       |\r\n\r\n## License\r\n\r\n`bevy_framepace` is free, open source and permissively licensed! Except where noted (below and/or in\r\nindividual files), all code in this repository is dual-licensed under either:\r\n\r\n* MIT License ([LICENSE-MIT](LICENSE-MIT) or\r\n  [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT))\r\n* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\r\n  [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0))\r\n\r\nat your option. This means you can select the license you prefer! This dual-licensing approach is\r\nthe de-facto standard in the Rust ecosystem and there are very good reasons to include both.\r\n\r\n### Your contributions\r\n\r\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the\r\nwork by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\r\nadditional terms or conditions.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faevyrie%2Fbevy_framepace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faevyrie%2Fbevy_framepace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faevyrie%2Fbevy_framepace/lists"}