Upgraded to Bevy 0.15

This commit is contained in:
Silas Bartha 2024-12-11 02:03:02 -05:00
parent 1242f8352a
commit 21c5461abd
5 changed files with 715 additions and 1544 deletions

2230
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
[package]
name = "bevy_outline_post_process"
version = "0.3.1"
version = "0.4.0"
edition = "2021"
description = "An adaptive outline post-processing effect for the Bevy game engine."
license = "0BSD OR MIT OR Apache-2.0"
repository = "https://git.exvacuum.dev/bevy_outline_post_process"
[dependencies.bevy]
version = "0.14"
version = "0.15"
default-features = false
features = ["bevy_render", "bevy_asset", "bevy_core_pipeline"]
features = ["bevy_render", "bevy_asset", "bevy_core_pipeline", "png"]

View File

@ -3,7 +3,6 @@
[![Crates](https://img.shields.io/crates/v/bevy_outline_post_process)](https://crates.io/crates/bevy_outline_post_process)
![License](https://img.shields.io/badge/license-0BSD%2FMIT%2FApache-blue.svg)
![Tag](https://img.shields.io/github/v/tag/exvacuum/bevy_outline_post_process)
![Build](https://img.shields.io/github/actions/workflow/status/exvacuum/bevy_outline_post_process/rust.yml)
[![Docs](https://img.shields.io/docsrs/bevy_outline_post_process)](https://exvacuum.github.io/bevy_outline_post_process)
A plugin for the [Bevy](https://bevyengine.org) engine which adds an outline post-processing effect. Optionally supports adaptive outlining, so darker areas are outlined in white rather than black, based on luminance.
@ -11,16 +10,17 @@ A plugin for the [Bevy](https://bevyengine.org) engine which adds an outline pos
Note: This is a full-screen post process effect and cannot be enabled/disabled for specific objects.
## Screenshots
![](./doc/screenshot.png)
![](./doc/screenshot_smooth.png)
![](https://git.exvacuum.dev/plain/doc/screenshot.png)
![](https://git.exvacuum.dev/plain/doc/screenshot_smooth.png)
Configuration Used:
```rs
bevy_outline_post_process::components::OutlinePostProcessSettings::new(2.0, 0.0, false);
bevy_outline_post_process::components::OutlinePostProcessSettings::new(2.0, 0.0, false, 0.0);
```
## Compatibility
| Crate Version | Bevy Version |
|--- |--- |
| 0.4 | 0.15 |
| 0.3 | 0.14 |
| 0.1-0.2 | 0.13 |
@ -29,13 +29,13 @@ bevy_outline_post_process::components::OutlinePostProcessSettings::new(2.0, 0.0,
### crates.io
```toml
[dependencies]
bevy_outline_post_process = "0.3"
bevy_outline_post_process = "0.4"
```
### Using git URL in Cargo.toml
```toml
[dependencies.bevy_outline_post_process]
git = "https://github.com/exvacuum/bevy_outline_post_process.git"
git = "https://git.exvacuum.dev/bevy_outline_post_process"
```
## Usage
@ -51,7 +51,6 @@ fn main() {
DefaultPlugins,
bevy_outline_post_process::OutlinePostProcessPlugin,
))
.insert_resource(Msaa::Off)
.run();
}
```
@ -59,9 +58,8 @@ fn main() {
When spawning a camera:
```rs
commands.spawn((
// Camera3dBundle...
NormalPrepass,
bevy_outline_post_process::components::OutlinePostProcessSettings::new(2.0, 0.0, false);
// Camera3d...
bevy_outline_post_process::components::OutlinePostProcessSettings::new(2.0, 0.0, false, 0.0);
));
```

View File

@ -1,11 +1,13 @@
use bevy::{
prelude::*,
render::{extract_component::ExtractComponent, render_resource::ShaderType},
core_pipeline::prepass::{NormalPrepass, DepthPrepass, DeferredPrepass},
};
/// Component which, when inserted into an entity with a camera and normal prepass, enables an outline effect for that
/// camera.
#[derive(Component, ShaderType, ExtractComponent, PartialEq, Clone)]
#[require(NormalPrepass, DepthPrepass, DeferredPrepass, Msaa(|| Msaa::Off))]
pub struct OutlinePostProcessSettings {
/// Weight of outlines in pixels.
weight: f32,

View File

@ -10,7 +10,6 @@ use bevy::{
TextureFormat, TextureSampleType,
},
renderer::RenderDevice,
texture::BevyDefault,
},
};
@ -71,6 +70,7 @@ impl FromWorld for OutlinePostProcessPipeline {
write_mask: ColorWrites::ALL,
})],
}),
zero_initialize_workgroup_memory: false,
});
Self {