diff options
author | Silas Bartha <[email protected]> | 2024-12-10 16:06:06 -0500 |
---|---|---|
committer | Silas Bartha <[email protected]> | 2024-12-10 16:06:06 -0500 |
commit | 3c229ff55b3ba1b618e00fb48f2b350709a58c02 (patch) | |
tree | d611701543a91b53399cf8029b124a725ccb1548 /README.md | |
parent | 3c711f2012c865c2a17077b2980c53437c4812bc (diff) |
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 26 |
1 files changed, 9 insertions, 17 deletions
@@ -3,7 +3,6 @@ [![Crates](https://img.shields.io/crates/v/bevy_headless_render)](https://crates.io/crates/bevy_headless_render) ![License](https://img.shields.io/badge/license-MIT%2FApache-blue.svg) ![Tag](https://img.shields.io/github/v/tag/exvacuum/bevy_headless_render) -![Build](https://img.shields.io/github/actions/workflow/status/exvacuum/bevy_headless_render/rust.yml) [![Docs](https://img.shields.io/docsrs/bevy_headless_render)](https://exvacuum.github.io/bevy_headless_render) A plugin for the [Bevy](https://bevyengine.org) engine which allows for headless rendering. @@ -15,19 +14,20 @@ Every frame will be copied from `HeadlessRenderSource` render textures into `Hea | Crate Version | Bevy Version | |--- |--- | | 0.1 | 0.14 | +| 0.2 | 0.15 | ## Installation ### crates.io ```toml [dependencies] -bevy_headless_render = "0.1" +bevy_headless_render = "0.2" ``` ### Using git URL in Cargo.toml ```toml [dependencies.bevy_headless_render] -git = "https://github.com/exvacuum/bevy_headless_render.git" +git = "https://git.exvacuum.dev/bevy_headless_render" ``` ## Usage @@ -41,9 +41,6 @@ fn main() { App::new() .add_plugins(( DefaultPlugins - .build() - .disable::<WinitPlugin>(), - ScheduleRunnerPlugin::run_loop(Duration::from_secs_f32(1.0 / TICK_RATE)), bevy_headless_render::HeadlessRenderPlugin, )) .run(); @@ -63,7 +60,7 @@ let mut image = Image { label: None, size, dimension: TextureDimension::D2, - format: TextureFormat::R8Unorm, + format: TextureFormat::Rgba8UnormSrgb, mip_level_count: 1, sample_count: 1, usage: TextureUsages::TEXTURE_BINDING @@ -76,20 +73,15 @@ let mut image = Image { image.resize(size); -let image_handle = images.add(image); // ResMut<Assets<Image>> +let image_handle = asset_server.add(image); commands.spawn(( - Camera3dBundle { - camera: Camera { - target: image_handle.clone().into(); - ..Default::default() - }, + HeadlessRenderSource::new(&asset_server, image_handle.clone()), + Camera3d::default(), + Camera { + target: image_handle.into(), ..Default::default() }, - bevy_headless_render::HeadlessRenderBundle { - source: headless_render_sources.add(HeadlessRenderSource(image_handle.clone())), // ResMut<Assets<HeadlessRenderSource>> - destination: HeadlessRenderDestination::default(), - }, )); ``` |