You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, the plugin will automatically measure your framerate and use this for framepacing.
25
26
26
-
You can adjust the framerate limit when adding the plugin, or at runtime by modifying the`FramepacePlugin` resource. For example, to set the framerate limit to 30fps:
27
+
You can adjust the framerate limit at runtime by modifying the`FramepaceSettings` resource. For
See `demo.rs` in the examples folder, or run with:
@@ -36,7 +38,14 @@ cargo run --release --example demo
36
38
37
39
## How it works
38
40
39
-
The plugin works by recording how long it takes to render each frame, and sleeping the main thread until the desired frametime is reached. This ensures the next frame isn't started until the very last moment, delaying the event loop from restarting. By delaying the event loop, and thus input collection, this reduces motion-to-photon latency by moving reading input closer to rendering the frame.
41
+
The plugin works by recording how long it takes to render each frame, and sleeping the main thread
42
+
until the desired frametime is reached. This ensures the next frame isn't started until the very
43
+
last moment, delaying the event loop from restarting. By delaying the event loop, and thus input
44
+
collection, this reduces motion-to-photon latency by moving reading input closer to rendering the
45
+
frame.
46
+
47
+
The `spin_sleep` dependency is needed for precise sleep times. The sleep function in the standard
48
+
library is not accurate enough for this application, especially on Windows.
40
49
41
50
42
51
## Bevy Version Support
@@ -45,24 +54,27 @@ I intend to track the `main` branch of Bevy. PRs supporting this are welcome!
45
54
46
55
| bevy | bevy_framepace |
47
56
| ---- | -------------- |
57
+
| 0.9 | 0.7 |
48
58
| 0.8 | 0.5, 0.6 |
49
59
| 0.7 | 0.4 |
50
60
| 0.6 | 0.3 |
51
61
52
62
53
63
## License
54
64
55
-
`bevy_framepace` is free, open source and permissively licensed! Except where noted (below and/or in individual files), all code in this repository is dual-licensed under either:
65
+
`bevy_framepace` is free, open source and permissively licensed! Except where noted (below and/or in
66
+
individual files), all code in this repository is dual-licensed under either:
56
67
57
-
* MIT License ([LICENSE-MIT](LICENSE-MIT) or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT))
58
-
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0))
at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.
73
+
at your option. This means you can select the license you prefer! This dual-licensing approach is
74
+
the de-facto standard in the Rust ecosystem and there are very good reasons to include both.
61
75
62
76
### Your contributions
63
77
64
-
Unless you explicitly state otherwise,
65
-
any contribution intentionally submitted for inclusion in the work by you,
66
-
as defined in the Apache-2.0 license,
67
-
shall be dual licensed as above,
68
-
without any additional terms or conditions.
78
+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the
79
+
work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
0 commit comments